Posted on 2006-03-24
Last Modified: 2008-01-16
I have written a UserControl that is essentially a textbox but when clicked brings up a new form which is supposed to mimic a menu. This menu form ideally should be shown as ShowDialog.

I have a Sub Main() with line
Application.Run(New MainForm)

MainForm includes this UserControl. I had problems on firing the MouseEnter/Leave events when using ShowDialog, but not when using the Show method. However the important thing was to see this form on top of MainForm, which it did.

As it happens, one of the menus loads a new form - OptionsForm
and it does this by
OptionsForm = New OptionsForm

now OptionsForm also has a menu UserControl (with a different lot of menus)
If I show this form using the Show method, I cannot get it to sit on top of the OptionsForm
and if I use the ShowDialog method I get an error "Forms cannot own themselves or their owners"

Help, please
Question by:broadbent
    LVL 5

    Expert Comment

    To do what you are trying to do please check out this site:

    They have a nice class you can download to help with this sort of thing.
    LVL 4

    Author Comment

    Maybe, but it doesn't answer the question put.

    As it happens, I think I now know the answer.
    You can't use Showdialog on a form that is itself put up using ShowDialog. This must be a weakness in Visual Studio.

    Accepted Solution

    Closed, 250 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now