请问,直线怎么穿过label,
解决方案 »
- winform中dagagridview绑定combox
- 非连接插入数据问题
- 一个链接数据库的问题
- 急!!!!怎么向SQL Server数据库中插入汉字??
- 哪位帮忙解决一下:查询access数据库时出错
- 为什么在本地可以,一旦上传服务器,老会出现这个问题WebForm_PostBackOptions未定义,急
- 散分喽,呵呵,小问题麻烦一下大虾
- 我有一个picturebox控件,想把它做成一个灰度色标,灰度从255到0.就如windows自带的画图工具挑选自定义颜色时的灰度条。
- 哪里有C#操作mdb文件的例子下载
- 有两个dataGrid.我想从dataGrid1中的记录中查找到指定记录,然后添加到dataGrid2中,应该怎样实现呢?
- textblock.Text="aaa"可以修改文字内容为"aaa",那么checkbox呢?
- textblock 的TextChanged事件,能否触发两个函数?
Form1_Paint(object sender,... e)
{
Point p1=new Point(label1.Location.X+label1.Width/2,0);
Point p2=new Point(label1.Location.X+label1.Width/2,Height);
Graphis g=e.Graphis;
g.DrawLine(p1,p2);
}。手写代码,仅提供思想。
在label中画直线,不能画吗?label的paint事件,
private void label1_Paint(object sender, PaintEventArgs e)
{
Pen pen1 = new Pen(Color.Black, 1);
Point p1 = new Point(label1.Location.X + label1.Width / 2, 0);
Point p2 = new Point(label1.Location.X + label1.Width / 2, Height);
Graphics g = e.Graphics;
g.DrawLine(pen1, p1, p2);
}
这样设置代码,应该行了吧,为什么在label中画不出直线呢?
谢谢!!!