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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.