Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to command a form shows on top than others ?

Status
Not open for further replies.

sisan

Programmer
Jan 9, 2002
39
ID
I need your helps, please..

Say I have 2 MDI child forms, A and B. Form A show first, then form B. So, form B is the most top than form A. Now how can I make form A on top than form B by command (without click on it) ?

Thanks for your attention.
 
Try this:

FormA.SetFocus
Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
and to stay on top use:

Call SetWindowPos(TheForm.hwnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, 2 Or 1)

Public 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

Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2

®od


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top