0

I have so many form in different module in one solution.
I already instantiate a new Form as a global variables in my parent form.
Then, call the code

frm.show()

in my button1 event
any idea?

4
Contributors
6
Replies
8
Views
7 Years
Discussion Span
Last Post by leahrose87
0

I want my all form will be called in one instance. For example, I have form1 and form2. Every time I click the button in form1 to show form2, it will check if form2 is already open or not. If open, then will just set the form2 to front and otherwise show a new form2. Hope you understand. God bless!

0

simple solution. don't make new instance of form2. on button click write
form2.Show
Form2.BringTofront()
if you have any parent form then write this code on that menustrip click event
Form2.MdiParent = Me
Form2.Show()
Form2.BringToFront()
try it works

0

I use generic codes because I have so many forms to show. I tried all your suggestion but still it didn't work. My forms information are stored in a database so if I want to show a certain form all I need to do is call the function showForm(ComponentName).Inside this function, I initialize a variable

Dim extForm As Form

Any idea?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.