hey, really simple question ... how can you make it so that your form is fixed so that you cannot click outside of it and loose it, ilke so that you can't click next to it and loose focus?
thanks
Printable View
hey, really simple question ... how can you make it so that your form is fixed so that you cannot click outside of it and loose it, ilke so that you can't click next to it and loose focus?
thanks
Like:
VB Code:
Option Explicit ' Form ALWAYS Ontop Const SWP_NOSIZE = &H1 Const SWP_NOMOVE = &H2 Const SWP_NOACTIVATE = &H10 Const SWP_SHOWWINDOW = &H40 Const HWND_Bottom = 1 Const HWND_Top = -1 Const HWND_NoTop = -2 Private Declare Sub SetWindowPos Lib "User32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _ ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) Private Sub Form_Paint() SetWindowPos Me.hwnd, HWND_Top, 0, 0, 0, 0, _ SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE End Sub
Bruce.
you should also take a look at tygurs sample : http://www.vbforums.com/attachment.php?s=&postid=321972
it will not let the mouse outside the form.
jesus christ man... do u live here?
If you mean Bruce, yes, he does.
thanks guys for your help...
Heh, naw, i meant pete, he's made 9000 something posts... i see bruce here all the time too though
holy ****, i have like 4 ... haha and he as like 9000 ... crazy.
Bruce, how does your method differ from loading the form as modal?
Or do you just like using APIs?
VB Code:
MyForm.Show vbModal
you can set focus to other apps with a modal form, I think that is what he is trying to avoid.
:lol: no.. but I have been around since august 2000...Quote:
Originally posted by Para80d
jesus christ man... do u live here?
well then maybe u can help!
nobody seems to wanna help me on this for some reason.. it's simple, just can't remember!!!
here
thanks