Juanton

I have a two forms FormFront and FormBack. When the program starts, FormBack is loaded and not enabled while the smaller FormFront is displayed in front of FormBack as a sort of welcome screen. I want FormFront to always be in front of FormBack when it is displayed, but I don't want it to be in front of any other program if the user shoud switch to a different program (like what happens with the "TopMost" setting set to true). FormBack.ShowInTaskBar = True but FormFront.ShowInTaskBar = False

My problem is when I switch to a different program and switch back to my program, FormBack is displayed (still disabled) while FormFront is hidden. Is there any way that whenever FormBack is displayed and the boolean variable Welcome = true that FormFront will be put in front FormBack.GotFocus will not work because FormBack is disabled. Anyway, hopefully someone can make sense of what I am trying to say. Thanks for your help!



Re: Visual Basic Express Edition Keep a Form on Top...Sometimes

bdbodger

Why don't you just hide the form or create a spash screen instead . You can put me.hide in the forms load event and use show later when you want to see the form . What about using code to minimize the form and set it back to normal when you need it or how about createing a new instance of the second form instead . Why do you have the form disabled Why show it if it is disabled




Re: Visual Basic Express Edition Keep a Form on Top...Sometimes

Juanton

In order to get the visual effect I desire, both forms need to be visible. FormBack could be considered the main application, and FormFront could be considered some kind of tool window. Think for example of using the "Save As" dialog in any program. If you switch programs and come back, you would expect the Save As dialog to still be on top. Even more so, you can't click anywhere on the anywhere on the main program untill the dialog closes. That is the effect I am trying to accomplish, but am struggling with. Sorry about my difficulty in expressing this. Does anyone have any idea how I can accomplish this



Re: Visual Basic Express Edition Keep a Form on Top...Sometimes

bdbodger

I think you just gave the answer in the load event of formback use formfront.showdialog then it will act like the save as dialog box and you won't be able to use formback untill you close the fromfront . You would then create new instances of formfront when you need to see it .

Code Block

dim form as new frontform

form.showdialog