[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 855
  • Last Modified:

.show() doesn't show the form VB.NET

I've global module whuch has sub main() from where the application starts and also a callback function. I load my MDI by deciding in the callback which MDI is to be loaded. C dll tells UI about this in the callback. Now once an MDI is loaded, say the callback in  global module recvs another instruction to load another MDI/form. Here if i use new form.show(), the control goes into the new form's load event and does all, but the form comes up and disappears. If i use showdialog(), then the form is seen but the control doesn't come back unless the newly opened form is closed. this is what i dont want. i want to return as well from the callback after opening the new form. .show() allows me that, but the form doesn't stay, and showdialog() doesn't allow be to retrn. and in the .show() scenario when i close the overall applicaiton it is not closed properly sometimes as the new form which is not seen but there in memory.

I've used Threads as well in the callback with new form in showdialog(), but even that behaves like a .show() now. and definite error of Null reference comes up when closing.

how can i make new form appear with returing from callback possible.

pl. help

pawan


0
pawan_marwar
Asked:
pawan_marwar
2 Solutions
 
Bob LearnedCommented:
If this is the first form in the application, use Application.Run(form).

Bob
0
 
Mikal613Commented:
dim FRm as new Formname

frm.ShowDialog()
0
 
YZlatCommented:
Dim f1 As New myForm()
        f1.Show()
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
RobertRFreemanCommented:
Do not dispose the frm after opening it.

f1.show()
'Do not do either of these:  f1.dispose or f1.close()
0
 
RobertRFreemanCommented:
I mention the above because I've seen the following:

f1.show()
f1.dispose()

which will show the form, running all events and then dispose it immediately thereafter.
show() will continue running code in the parent form, showdialog() will not.
0
 
RobertRFreemanCommented:
Hey, I want points too. :-P

I don't think Mikal613 or YZlat answered the question.  It sounds like the asker already got that far.
 
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now