[英]C# Draw when window is loaded
I want to draw some ellipses when the window is loaded
without clicking anything, how can I do it? 我想在
loaded
窗口时绘制椭圆,而不单击任何东西,该怎么办? My code is the following : 我的代码如下:
int kerX = random.Next(10,281);
int kerY = random.Next(10,281);
mrPainter.FillEllipse(Brushes.Black, kerX + 10, kerY + 10, 20, 20);
mrPainter.FillEllipse(blue,65,65,20,20);
mrPainter.FillEllipse(red, 205, 65, 20, 20);
mrPainter.FillEllipse(yellow, 135, 215, 20, 20);
假设您正在使用WinForms,只需将代码插入主窗体的FormLoaded
事件中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.