我遇到了问题。有我想用作我的paiting窗口的panel1。而且我也有2个按钮。应该在面板中间画“fillRectangle”,第二个应该在旁边画“fillellipse”。我没有绘图本身的问题C++/CLI Visual C++ 2010 Express - 在一个面板内绘制不同的形状
Color aColor = Color::FromArgb(255, 0, 0);
SolidBrush^ aBrush = gcnew SolidBrush(aColor);
Rectangle rect = Rectangle(x, y, 10, 10);
e->Graphics->FillEllipse(aBrush, rect);
但我想知道,如何使按下每个按钮绘制不同的面板内的形状。我是否需要把两者在panel1_Paint和使用国旗像椭圆形,长方形......
if(ellip == 1) FillEllipse;
if(recta == 1) FillRectangle
被使用按钮设置?我希望我可以在按钮或函数内编写绘图部分,然后以某种方式引用该面板。可能吗?