using topmost

toostage

Member
Joined
Apr 26, 2006
Messages
12
Programming Experience
1-3
i've got a problem:

i've got 3 forms, 1 form = mainform including a richtextbox = rtb
the other 2 forms are forms which are used as toolboxxes with style control etc.

now when i use the topmost property on the 2 toolboxxes, then the toolboxxes are always @ top, even over other applications like internet explorer.

so i've tried bringtofront but that aint working, on bringtofront the toolbox is automaticly selected, but then when i'm trying to type a text in the mainform.rtb the toolbox is gone again. So that aint working either.

Usage of modal forms aint an option, because the toolboxxes should be on top over the mainform and then i should still be abel to enter text on the mainform.

(like the toolboxxes in photoshop)

any one who can help me a little bit?

(hope my english is good enough to explain my situation)
 
Don't use TopMost property for this, instead set the Owner property of the toolboxx form to the instance of mainform. Read all about the behaviour of owned forms in the documentation. Example:
VB.NET:
Expand Collapse Copy
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Shown
  Dim tool As New toolboxxForm
  tool.Owner = Me
  tool.Show()
End Sub
Another option to same path is to use the Form methods AddOwnedForm and RemoveOwnedForm.

(by the way, BringToFront method is for control on forms, not the forms themselves.)
 
Back
Top