C#winform窗体边框风格怎么样做的呢?

C#winform窗体边框风格怎么样做的呢?

我意思就是,创建了一个窗体后,想让窗体的边框,用图片,就好象QQ的边框那样,或者像酷狗那些边框一样,有圆滑的效果,怎么做呢?
还剩,无边框窗体的拖动\关闭等事件处理,怎么解决呢??

首先,窗体的FormBorderStyle设置成None,不要控制边框

TransparencyKey和BackColor颜色设置成相同的,这样,窗体就透明了

以此为基础,制作透明不规则窗体,可以在窗体上设圆角背景图片,也可以绘制

还要解决的是无边框窗体的拖动\关闭等事件处理.
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-04-07
楼上说的太好了,但是没说如何做成圆滑的啊,那主要是美工,你用photoshop或者绘图等工具处理下
//移动窗体
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Left += e.Location.X - this.oldX; //新的鼠标位置
this.Top += e.Location.Y - this.oldY;
}
}

private int oldX = 0;
private int oldY = 0;

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.oldX = e.Location.X; //鼠标原来位置
this.oldY = e.Location.Y;
}
}
//关闭窗体
private void picClose_Click(object sender, EventArgs e)
{
Application.Exit();
}
第2个回答  2009-04-07
使用第三方控件
第3个回答  2009-04-07
楼上说的太好了,但是没说如何做成圆滑的啊,那主要是美工,你用photoshop或者绘图等工具处理下
//移动窗体
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Left += e.Location.X - this.oldX; //新的鼠标位置
this.Top += e.Location.Y - this.oldY;
}
}

private int oldX = 0;
private int oldY = 0;

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.oldX = e.Location.X; //鼠标原来位置
this.oldY = e.Location.Y;
}
}
//关闭窗体
private void picClose_Click(object sender, EventArgs e)
{
Application.Exit();
}
第4个回答  2009-04-07
使用第三方控件
相似回答
大家正在搜