C# winform中如何控制背景图片的垂直位置? 在web中,一个背景图片的位置我们可以用CSS来控制,例如 background:url(xx.jpg) no-repeat 0(水平) -40(垂直);现在,我想在winform中控制一个背景图片的垂直位置.容器是picturebox,有什么属性或者应该怎么设置呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 好像除了在Paint事件里重画没有办法来设置这个坐标。 这个简单啊,参考如下:public partial class Form3 : Form{ private Point m_ImagePoint; public Point ImagePoint { get { return m_ImagePoint; } set { m_ImagePoint = value; } } private Image m_Image; public Image Image { get { return m_Image; } set { m_Image = value; } } public Form3() { InitializeComponent(); this.DoubleBuffered = true; } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (this.m_Image != null) { e.Graphics.DrawImage(this.m_ImagePoint.X, this.m_ImagePoint.Y, this.m_Image.Width, this.m_Image.Height); } }} 改一下,代码有误:protected override void OnPaint(PaintEventArgs e){ base.OnPaint(e); if (this.m_Image != null) { e.Graphics.DrawImage(this.m_Image, this.m_ImagePoint.X, this.m_ImagePoint.Y, this.m_Image.Width, this.m_Image.Height); }} C# + SQL 在我的.net程序中,有多个结构相同的数据, 请问怎么计算时间阿? 垃圾收集问题——是不是bug 做个调查,有多少人用C#做WINFORM? 关于GroupBox的点击触发事件 将一个正则表达式在CS文件中输出时出错(续) [高分请教]C#读取Excel数据,文件中某些数据竟然读到DataSet中却为空? 急急急!!急寻C#.NET和ASP.NET的培训资料 字符串正则匹配(急) 已有打开的与此命令相关联的 DataReader,必须首先将它关闭。 为什么我的删除不了
{
private Point m_ImagePoint; public Point ImagePoint
{
get { return m_ImagePoint; }
set { m_ImagePoint = value; }
} private Image m_Image; public Image Image
{
get { return m_Image; }
set { m_Image = value; }
} public Form3()
{
InitializeComponent();
this.DoubleBuffered = true;
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (this.m_Image != null)
{
e.Graphics.DrawImage(this.m_ImagePoint.X, this.m_ImagePoint.Y, this.m_Image.Width, this.m_Image.Height);
}
}
}
{
base.OnPaint(e);
if (this.m_Image != null)
{
e.Graphics.DrawImage(this.m_Image, this.m_ImagePoint.X, this.m_ImagePoint.Y, this.m_Image.Width, this.m_Image.Height);
}
}