CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2001
    Posts
    15

    Form Always on top?

    how do i put a form always on top of the other??? tnx.


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Form Always on top?

    See http://63.236.73.79/cgi-bin/bbs/wt/s...collapsed&sb=5

    HTH,

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Oct 2001
    Location
    Hyderabad,India
    Posts
    8

    Re: Form Always on top?

    Hi,

    Use this for always on top of the other...


    form1.zorder 0




    OR

    Use this "form1.show vbModal" for top most window.

    OR

    Use this API to make top most window.


    private Declare Function 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) as Long

    Const HWND_TOPMOST = -1

    SetWindowPos form1.hWnd, HWND_TOPMOST, 0, 0, 0, 0, 2 Or 1





    Thanks,
    Vikranth.


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

Featured