restabro
asked on
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::P aintEventA rgs * 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::Obj ect * sender, System::Windows::Forms::Pa intEventAr gs * e)
{
if (this->mcfLimitMenu->Check ed == true)
draw100MCF(e);
}
draw100MCF================ ========
void OutputBox::draw100MCF(Syst em::Window s::Forms:: PaintEvent Args * 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?
OutputBox..h==============
void draw100MCF(System::Windows
private: System::Void mcfLimitMenu_Click(System:
{
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::Obj
{
if (this->mcfLimitMenu->Check
draw100MCF(e);
}
draw100MCF================
void OutputBox::draw100MCF(Syst
{
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.