Show a message when a property page loads?

Posted on 2006-04-21
Last Modified: 2010-04-16

Im trying to show a message when I load a property page.

If I do

protected void OnLoad(EventArgs e)
            MessageBox.Show("this is a test");

It says

Warning      19      'DefaultControlsPlugin.Design.ControlPropertyPages.ElementLabelControlPropertyPage.OnLoad(System.EventArgs)' hides inherited member 'System.Windows.Forms.UserControl.OnLoad(System.EventArgs)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.      

Which is fine so I do

protected override void OnLoad(EventArgs e)
            MessageBox.Show("this is a test");
but that shows the message before the property page appears?


Question by:paulwhelan
    1 Comment
    LVL 5

    Accepted Solution

    I don't know about this "property page" thingy, but I guess the following could do the trick:

      protected override void OnShown(EventArgs e) {
        MessageBox.Show("this is a test");

    Used on a form, this event is called whenever the form is opened for the first time. The effect is, whenever you open the form, the form is displayed and at the same time your message box appears. You cannot access the form, before the message box has been closed. This is probably what you want - not letting the user modify properties before reading some instructions!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Top Freelancers to Complete C# Projects

    Source the talented Expert Exchange community
    for top quality work on your C# projects.

    Hire the best. Collaborate easily. Get quality work.

    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    761 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

    12 Experts available now in Live!

    Get 1:1 Help Now