|
-
Nov 21st, 2003, 01:21 AM
#1
Thread Starter
Lively Member
stupid question
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
-
Nov 21st, 2003, 01:30 AM
#2
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.
Last edited by Bruce Fox; Dec 1st, 2003 at 04:26 PM.
-
Nov 21st, 2003, 02:15 AM
#3
-= B u g S l a y e r =-
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.
-
Nov 21st, 2003, 02:16 AM
#4
Addicted Member
jesus christ man... do u live here?
C++/VB6&.NET/QBasic/HTML/PHP/MySQL/SQLServer2k
I'm the guy your little brother looks a lot alike. Tell your mom i said thanks.
naked in vegas
-
Nov 21st, 2003, 02:48 AM
#5
Frenzied Member
If you mean Bruce, yes, he does.
-
Nov 21st, 2003, 11:59 AM
#6
Thread Starter
Lively Member
thanks guys for your help...
-
Nov 21st, 2003, 12:06 PM
#7
Addicted Member
Heh, naw, i meant pete, he's made 9000 something posts... i see bruce here all the time too though
Last edited by Para80d; Nov 21st, 2003 at 01:03 PM.
C++/VB6&.NET/QBasic/HTML/PHP/MySQL/SQLServer2k
I'm the guy your little brother looks a lot alike. Tell your mom i said thanks.
naked in vegas
-
Nov 21st, 2003, 12:10 PM
#8
Thread Starter
Lively Member
holy ****, i have like 4 ... haha and he as like 9000 ... crazy.
-
Nov 21st, 2003, 12:32 PM
#9
Lively Member
Bruce, how does your method differ from loading the form as modal?
Or do you just like using APIs?
-
Nov 21st, 2003, 04:31 PM
#10
-= B u g S l a y e r =-
you can set focus to other apps with a modal form, I think that is what he is trying to avoid.
-
Nov 21st, 2003, 04:37 PM
#11
-= B u g S l a y e r =-
Originally posted by Para80d
jesus christ man... do u live here?
no.. but I have been around since august 2000...
-
Nov 21st, 2003, 04:44 PM
#12
Addicted Member
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
C++/VB6&.NET/QBasic/HTML/PHP/MySQL/SQLServer2k
I'm the guy your little brother looks a lot alike. Tell your mom i said thanks.
naked in vegas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|