Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In my vb.net form i want to when i click the button the another will be opened, that form's window state is normal. I give the coding
VB
Form2.show()

But the form2 is displayed it will not be displayed in front of the form1. it displays in back of the form1 so i give
VB
Form2.show
form2.bringtofront

But it is not working how to do it please any body help
Posted
Updated 3-Jan-12 19:38pm
v2

To open the expected form first.Go to project menu and then select windows application 1 properties (or the name of the application) there will be startup form option with dropdown list. In that, select what form you have to run eg:form2

I think this solves your problem.
 
Share this answer
 
you should try to set true of TopMost property after the window desired to be TopMost is displayed by Show() method.
Form.TopMost Property [^] which is used to Gets or sets a value indicating whether the form should be displayed as a topmost form.
 
Share this answer
 
You may try this one.

Form2 objForm = new Form2();
objForm.Activate();
objForm.Visible = true;


This is in C# form. You may use code converter to see the result...
 
Share this answer
 
I got the answer

I give form1.bringtofront()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900