Forcing a Paint Event with a menu selection

Posted on 2006-04-22
Last Modified: 2010-08-05
I'm trying to to use a Main Menu selection to draw some graphics on a tab page within the same form. I'm not sure how to do there a way to force a Paint Event when the menu item is selcted? This is the code I have so far.


void draw100MCF(System::Windows::Forms::PaintEventArgs *  e)

private: System::Void mcfLimitMenu_Click(System::Object *  sender, System::EventArgs *  e)
      draw100MCF(e);  //this is the function that draws on the TabPage. This doesn't work
                                          //since this "e" isn't the "PaintEventArgs e" that the function is expecting

private: System::Void tabPage1_Paint(System::Object *  sender, System::Windows::Forms::PaintEventArgs *  e)
       if (this->mcfLimitMenu->Checked == true)


void OutputBox::draw100MCF(System::Windows::Forms::PaintEventArgs *  e)
      Graphics* pg = e->Graphics;
      Pen* pen1 = new Pen(Color::Black, 3.0);


Is there a way to have the "mcfLimitMenu_Click" do nothing more than force a "tabPage1 Paint Event" to be fired?
Question by:restabro
    1 Comment
    LVL 48

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
    In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    794 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

    18 Experts available now in Live!

    Get 1:1 Help Now