?
Solved

Show a message when a property page loads?

Posted on 2006-04-21
1
Medium Priority
?
204 Views
Last Modified: 2010-04-16
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


0
Comment
Question by:paulwhelan
1 Comment
 
LVL 5

Accepted Solution

by:
pgloor earned 120 total points
ID: 16509140
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

807 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