Show a message when a property page loads?

Hi

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?

Thanks
Paul


paulwhelanAsked:
Who is Participating?
 
pgloorCommented:
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!

Peter
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.