怎么设置winfrom窗体透明背景?

xzq12345 2010-01-07 02:59:19
窗体
...全文
755 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
happyer_longlong 2010-01-07
  • 打赏
  • 举报
回复
form.TransparencyKey =form.BackColor;
控件的话 需要 你 设置前景色
LorenLiu 2010-01-07
  • 打赏
  • 举报
回复
this.FormBorderStyle = FormBorderStyle.None;
this.TransparencyKey = this.BackColor;
mytimes_walker 2010-01-07
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 xzq12345 的回复:]
引用 1 楼 mytimes_walker 的回复:
C# codeusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace winform
{publicpartialcla?-


我只想让 窗体透明, 控件不透明,行吗?比如说图片,picBox ,label 上的文字
[/Quote]
http://www.cnblogs.com/Allnen/archive/2007/12/25/1014490.html
xzq12345 2010-01-07
  • 打赏
  • 举报
回复
不是整个透明,背景透明
xzq12345 2010-01-07
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 mytimes_walker 的回复:]
C# codeusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace winform
{publicpartialcla?-
[/Quote]

我只想让 窗体透明, 控件不透明,行吗?比如说图片,picBox ,label 上的文字
十八道胡同 2010-01-07
  • 打赏
  • 举报
回复
设置Opacity就可以了
CCppMfc 2010-01-07
  • 打赏
  • 举报
回复
Opacity
shizhen_zhang 2010-01-07
  • 打赏
  • 举报
回复
this.Opacity = 0.3; //( 0-1 之间就行了)
mytimes_walker 2010-01-07
  • 打赏
  • 举报
回复
其实就是设置Opacity 的值;
mytimes_walker 2010-01-07
  • 打赏
  • 举报
回复

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace winform
{
public partial class Form1 : Form
{
public Form1()
{

this.Location = new Point(100, 100);
this.Cursor = System.Windows.Forms.Cursors.Hand;// 定义在窗体上,光标显示为手形
this.Text = "透明窗体";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;// 定义窗体的开始显示位置是屏幕的中间
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.ForeColor = System.Drawing.SystemColors.Desktop;
this.Font = new System.Drawing.Font("宋体", 9);
this.BackColor = System.Drawing.Color.Blue;
this.ClientSize = new Size(440, 170);

this.Opacity = 0.1;
}

public static void Main()
{
Application.Run(new Form1());
}
}
}

111,077

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧