Reputation: 4655
Can't find how to get new window (form) which will behave like "Find and replace" window in VB IDE 2008, where window is allways on top and I can work on it but I can also work with underlayed code bit find and replace don't hide when I set focus to code window.
The best solution will be if I would be oopen more than one such window.
This is how I try but opened window is modal!
Dim fl As New myWindow
With fl
.StartPosition = FormStartPosition.Manual
.aCallerLocation = Me.Location
End With
Dim ret As Integer = fl.ShowDialog(Me)
fl.Close()
fl = Nothing
Upvotes: 1
Views: 177
Reputation: 43743
Showing the form as a dialog form, is not necessary to make the form stay in front of the primary form. Using the ShowDialog
method causes the form to be modal. What makes it stay in front is the fact that you are passing Me
for the owner
parameter. You can still pass an owner form, even if you are just calling the non-modal Show
method:
Dim fl As New myWindow()
' ...
fl.Show(Me)
That way, the new form will stay in front of the primary form, but it will not be modal. Therefore, both forms will be usable and you can show as many of those non-modal child forms in front of the primary form as you like.
Upvotes: 2