• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Forcing a Paint Event with a menu selection

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 this...is 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?
1 Solution

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now