• 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.

OutputBox..h=================

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)
            draw100MCF(e);
 }

draw100MCF========================

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

                DrawLine(pen1,....etc.);
}

Is there a way to have the "mcfLimitMenu_Click" do nothing more than force a "tabPage1 Paint Event" to be fired?
0
restabro
Asked:
restabro
1 Solution
 
AlexFMCommented:
tabPage1->Invalidate();
0

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