vb.net 2003 在智能设备开发中, panel控件中画线出现错误, 急!

far 2004-11-22 10:54:00
Dim x As Single = 0.0F
Dim y As Single = 0.0F
Dim width As Single = 50.0
Dim height As Single = 50.0
Dim g As Graphics = Panel1.CreateGraphics()
Dim myBrush As New SolidBrush(Color.Gray)
g.BackColor = Color.Blue
g.FillEllipse(myBrush, x, y, width, height)
编译可以通过,但是在wince模拟器里面运行时Dim g As Graphics = Panel1.CreateGraphics()出现异常错误
...全文
63 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
aawolf 2004-11-22
  • 打赏
  • 举报
回复
没试过,不敢胡说,回家试试再说。

什么异常?
仰泳的鱼儿 2004-11-22
  • 打赏
  • 举报
回复
I don't know why you want to use this syntax "Panel1.CreateGraphics()"?
I override the "OnPaint" Event,like the following codes:

/// <summary>
/// 绘制过程,覆盖control,但不要在子类中覆盖该事件
/// 而覆盖其Draw事件
/// </summary>
/// <param name="e">绘制事件参数</param>
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.FillEllipse(....)
}

in here:System.Windows.Forms.Control=control.

19,498

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧