How to make a form on the top of all forms?
-
as topic, if i have form1 and form2, form1 active form2 by using form2.show how to make form2 on the top of form1 which make user cannot click on form1? i used form2.topmost = True, although form2 is on the top of form1 but user still can click on form1 which make form1 become the active form and form2 become inactive wat i require is user must close form2 first b4 they can clickon form1 how am i going to do that?anyone can help? any help is greatly appreciated....
-
as topic, if i have form1 and form2, form1 active form2 by using form2.show how to make form2 on the top of form1 which make user cannot click on form1? i used form2.topmost = True, although form2 is on the top of form1 but user still can click on form1 which make form1 become the active form and form2 become inactive wat i require is user must close form2 first b4 they can clickon form1 how am i going to do that?anyone can help? any help is greatly appreciated....
-
when you are showing the form2 just say form2.show vbmodal. then the user cannot click form1:)
If you want to use the form as an information area, you can also try the following: '//////////////////////////////////////////////// '// StayOnTop '// '// This subroutine will force the form to stay '// at the topmost level. '// '// entry: flgActivate enable OnTop TRUE '// disable OnTop FALSE '//////////////////////////////////////////////// Private Sub StayOnTop(flgActivate As Boolean) Dim SetWinOnTop As Long Dim myFlag As Integer If flgActivate Then myFlag = HWND_TOPMOST ' Make this the topmost window Else myFlag = HWND_NOTOPMOST End If SetWinOnTop = SetWindowPos(Form3.hWnd, myFlag, 0, 0, 0, 0, &H1) End Sub