Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 17974
Number of posts: 55343

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Form to stay at front even when lost focus Posted by chris_hurley on 4 Mar 2006 at 10:41 AM
Hi,

I'm writing an app with multiple forms,
There is a navigation form with several buttons (each corresponding to a form containing various components) that i need to remain in view at all times so it does not dissapear when i click on one of the component forms (all component forms are full screen).

At present i get around this by having the component forms placed to the right of the navigation form so when focus is lost it is still visible. However i want to display the component forms full screen so desktop can't be seen when it's used on alternative sized monitors.

Is there a way I can permanently set the navigation form to be at the front regardless of focus. Any help would be much appreciated.

Cheers, Chris
Report
Re: Form to stay at front even when lost focus Posted by lionb on 6 Mar 2006 at 5:57 AM
This message was edited by lionb at 2006-3-6 5:57:49


Try this
Command1 control placed on Form1.
Private Sub Command1_Click()
Form2.Show
Form1.ZOrder
End Sub



Report
Re: Form to stay at front even when lost focus Posted by infidel on 7 Mar 2006 at 8:33 AM
: This message was edited by lionb at 2006-3-6 5:57:49

:
: Try this
: Command1 control placed on Form1.
:
: Private Sub Command1_Click()
: Form2.Show
: Form1.ZOrder
: End Sub
: 


Will Form1 continue to be on top if the user clicks on Form2? I think there's an API call to do what the user wants, by setting some kind of special attribute value on the window.


infidel

$ select * from users where clue > 0
no rows returned


Report
Re: Form to stay at front even when lost focus Posted by lionb on 7 Mar 2006 at 11:15 AM
This message was edited by lionb at 2006-3-7 11:23:57

This message was edited by lionb at 2006-3-7 11:16:6

: : This message was edited by lionb at 2006-3-6 5:57:49

: :
: : Try this
: : Command1 control placed on Form1.
: :
: : Private Sub Command1_Click()
: : Form2.Show
: : Form1.ZOrder
: : End Sub
: : 

:
: Will Form1 continue to be on top if the user clicks on Form2? I think there's an API call to do what the user wants, by setting some kind of special attribute value on the window.
:
:
: infidel
:
:
: $ select * from users where clue > 0
: no rows returned
: 

:
:
I am not sure about API but it will, if you write code like this
Private Sub Form_Click() 'Form2
Form1.ZOrder
End Sub

I think ZOrder method calls that API




Report
Re: Form to stay at front even when lost focus Posted by lionb on 7 Mar 2006 at 11:23 AM
:
: Will Form1 continue to be on top if the user clicks on Form2? I think there's an API call to do what the user wants, by setting some kind of special attribute value on the window.
:
:
: infidel
:
:
: $ select * from users where clue > 0
: no rows returned
: 

:
:
Do you mean this API SetWindowPos? I have never tried it.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.