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

Posted on 2004-11-09
Last Modified: 2008-08-26
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, 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


Question by:pawan_marwar
    LVL 96

    Accepted Solution

    If this is the first form in the application, use Application.Run(form).

    LVL 48

    Assisted Solution

    dim FRm as new Formname

    LVL 35

    Expert Comment

    Dim f1 As New myForm()
    LVL 16

    Expert Comment

    Do not dispose the frm after opening it.
    'Do not do either of these:  f1.dispose or f1.close()
    LVL 16

    Expert Comment

    I mention the above because I've seen the following:

    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.
    LVL 16

    Expert Comment

    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.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Normally a window is moved by clicking on the caption bar and dragging. You may want your user to be able to move borderless forms or move a form by clicking anywhere in the form without the limitation to the caption bar. There are many ways to do i…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    This video discusses moving either the default database or any database to a new volume.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now