Results 1 to 12 of 12

Thread: stupid question

  1. #1

    Thread Starter
    Lively Member heartisablack's Avatar
    Join Date
    Nov 2003
    Location
    new jersey
    Posts
    96

    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

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Like:
    VB Code:
    1. Option Explicit
    2.  
    3. ' Form ALWAYS Ontop
    4. Const SWP_NOSIZE = &H1
    5. Const SWP_NOMOVE = &H2
    6. Const SWP_NOACTIVATE = &H10
    7. Const SWP_SHOWWINDOW = &H40
    8. Const HWND_Bottom = 1
    9. Const HWND_Top = -1
    10. Const HWND_NoTop = -2
    11.  
    12. Private Declare Sub SetWindowPos Lib "User32" (ByVal hwnd As Long, _
    13.   ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
    14.   ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
    15.  
    16. Private Sub Form_Paint()
    17.     SetWindowPos Me.hwnd, HWND_Top, 0, 0, 0, 0, _
    18.     SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
    19. End Sub




    Bruce.
    Last edited by Bruce Fox; Dec 1st, 2003 at 04:26 PM.

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    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.
    -= a peet post =-

  4. #4
    Addicted Member Para80d's Avatar
    Join Date
    Oct 2003
    Location
    Denton, TX
    Posts
    160
    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

  5. #5
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    If you mean Bruce, yes, he does.

  6. #6

    Thread Starter
    Lively Member heartisablack's Avatar
    Join Date
    Nov 2003
    Location
    new jersey
    Posts
    96
    thanks guys for your help...

  7. #7
    Addicted Member Para80d's Avatar
    Join Date
    Oct 2003
    Location
    Denton, TX
    Posts
    160
    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

  8. #8

    Thread Starter
    Lively Member heartisablack's Avatar
    Join Date
    Nov 2003
    Location
    new jersey
    Posts
    96
    holy ****, i have like 4 ... haha and he as like 9000 ... crazy.

  9. #9
    Lively Member adBSTRD's Avatar
    Join Date
    Oct 2003
    Posts
    116
    Bruce, how does your method differ from loading the form as modal?

    Or do you just like using APIs?

    VB Code:
    1. MyForm.Show vbModal

  10. #10
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    you can set focus to other apps with a modal form, I think that is what he is trying to avoid.
    -= a peet post =-

  11. #11
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Originally posted by Para80d
    jesus christ man... do u live here?
    no.. but I have been around since august 2000...
    -= a peet post =-

  12. #12
    Addicted Member Para80d's Avatar
    Join Date
    Oct 2003
    Location
    Denton, TX
    Posts
    160
    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
  •  



Click Here to Expand Forum to Full Width