-
Jan 15th, 2018, 03:51 AM
#1
Thread Starter
New Member
Form on another form
If I have my main window open and I open another form on top of that, to prevent the form from underneath being touched I used to use for example
Code:
Form10.ShowDialog(Me)
but now I can't seem to use that, what do I use now?
Last edited by GeGeek; Jan 15th, 2018 at 09:17 AM.
-
Jan 15th, 2018, 04:17 AM
#2
Re: Form on another form
ShowDialog() is correct its just your way of using it thats wrong.
What you should be doing is in the Main Form calling your pop-up form like this - (assuming the name of you second form is FrmPopup)
Code:
Dim frm As New FrmPopup
frm.ShowDialog()
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Jan 15th, 2018, 04:27 AM
#3
Re: Form on another form
You can still use that same code in most cases. That said, specifying an owner for a modal dialogue is rather pointless. Are you doing it just because or does it offer some advantage that I'm not able to fathom right now? Also, you will only be able to use the default instance of a form class if it has a default instance, which will not be the case if it has no parameterless constructor. I would tend to recommend that people not use default instances at all but I'd also recommend that they understand what a default instance is and why they would or wouldn't use one.
-
Jan 15th, 2018, 09:17 AM
#4
Thread Starter
New Member
Re: Form on another form
Wait a sec, this is now my own fault after realizing the major boo boo I have done, here is me thinking why is none of this working, then takes a closer look at the vb form, its not vb its cs
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|