在按钮的属性里面找下,把边框、背景、阴影都去掉,就只剩下字了。
大体思路可以按照这个来
btn.FlatStyle = FlatStyle.Flat;//样式
btn.ForeColor = Color.Transparent;//前景
btn.BackColor = Color.Transparent;//去背景
btn.FlatAppearance.BorderSize = 0;//去边线
btn.FlatAppearance.MouseOverBackColor = Color.Transparent;//鼠标经过
btn.FlatAppearance.MouseDownBackColor = Color.Transparent;//鼠标按下
你可以把图片隐藏起来,有个属性Visible
不如直接用Label
你放个按钮,但又不想显示按钮,那你为什么要放按钮,为什么不放label,label也可以点击啊
已经解决了
private void Form1_Load(object sender, EventArgs e)
{
PictureBox pb = this.pictureBox1;
this.button1.FlatStyle = FlatStyle.Flat;
this.button1.BackColor = Color.Transparent;
this.button1.FlatAppearance.BorderSize = 0;
this.button1.Parent = pb;
}
也可以加上this.button1.FlatAppearance.MouseOverBackColor = Color.Transparent;
this.button1.FlatAppearance.MouseDownBackColor = Color.Transparent;