900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > c# winform窗体边框风格的设计

c# winform窗体边框风格的设计

时间:2019-06-28 02:10:02

相关推荐

c# winform窗体边框风格的设计

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

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

3.最后,窗体的拖动

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; } }

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。