Windows mobile怎么使用CreateGraphics 不是这个的问题,可能是其他的,比如ImageAttributes的问题。可能出错的相关的函数贴出来看看。wince我非常熟悉,但不看到代码有点不记得,我以前也遇到过很多次类似问题,但看了你代码才能记得起来。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 大牛们帮忙看看吧,谢谢啦,调试到Graphics gp = lblmode.CreateGraphics();就有问题了,我用的是penal控件 private bool[,] struArr = new bool[4, 4]; private Color blockColor = Color.Red; private void lblmode_Paint(object sender, PaintEventArgs e) { Graphics gp = e.Graphics; gp.Clear(Color.Black); Pen p = new Pen(Color.White); for (int i = 31; i < 123; i = i + 31) gp.DrawLine(p, 1, i, 123, i); for (int i = 31; i < 123; i = i + 31) gp.DrawLine(p, i, 1, i, 123); } private void lblmode_MouseDown(object sender, MouseEventArgs e) { if (e.Button != MouseButtons) return; int xPos, yPos; xPos = e.X / 31; yPos = e.Y / 31; struArr[xPos, yPos] = !struArr[xPos, yPos]; bool b = struArr[xPos, yPos]; Graphics gp = lblmode.CreateGraphics(); SolidBrush s = new SolidBrush(b ? blockColor : Color.Black); gp.FillRectangle(s, 31 * xPos + 1, 31 * yPos + 1, 30, 30); gp.Dispose(); } c# 修改字段 SQL中导出数据到EXCEL2007,老是提示我“错误的列名” 请求,c#中对于结构的理解! 请问:CheckBox选中以后依然返回false的问题 关于.net C#连接DB2数据库的步骤方法? DEV treelist实现更新 大虾来 winform应用程序打包时怎样将.Net框架一起嵌入,如果存在.net框架就不安装框架否则就安装 c# 动态生成label 谁能给我个详细的源代码? 安装问题? 关于自定义控件的属性问题(C#) windows mobile如何实现在click事件获取坐标值 现有一“万年历”的网页,怎么编写一个form显示这个网页??
private bool[,] struArr = new bool[4, 4];
private Color blockColor = Color.Red; private void lblmode_Paint(object sender, PaintEventArgs e)
{
Graphics gp = e.Graphics;
gp.Clear(Color.Black);
Pen p = new Pen(Color.White);
for (int i = 31; i < 123; i = i + 31)
gp.DrawLine(p, 1, i, 123, i);
for (int i = 31; i < 123; i = i + 31)
gp.DrawLine(p, i, 1, i, 123); } private void lblmode_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons)
return;
int xPos, yPos;
xPos = e.X / 31;
yPos = e.Y / 31;
struArr[xPos, yPos] = !struArr[xPos, yPos];
bool b = struArr[xPos, yPos];
Graphics gp = lblmode.CreateGraphics();
SolidBrush s = new SolidBrush(b ? blockColor : Color.Black);
gp.FillRectangle(s, 31 * xPos + 1, 31 * yPos + 1, 30, 30);
gp.Dispose();
}