首页
统计
关于
骗子曝光
Search
1
电脑微信企业微信双开/多开的方法(这可能是最简单粗暴高效的解决方案)
2,356 阅读
2
宝塔面板7.7.0版本原版安装+升级脚本(宝塔面板7.6.0破解版)
767 阅读
3
网址自动推送百度API源码(PHP源码)(百度php推送源代码)
700 阅读
4
宝塔LINUX企业永久付费破解版(宝塔企业版破解版)所有专业版企业版插件免费使用!
564 阅读
5
宝塔面板插件破解方法(宝塔面板插件破解方法教程)
518 阅读
闲聊
线报
WinForm
WinForm成品
WinForm源码
WinForm代码段
WEB
HTML代码
PHP代码
网站文章
网站源码
建站程序
Typecho
Typecho模板
Typecho插件
服务器运维面板
宝塔面板
网络安全
软件工具
技术教程
域名
自营程序
短链网DLW.IM
登录
Search
标签搜索
宝塔面板
源码
BT
WinForm
PHP
Telegram
百度
Typecho
CDN
谷歌翻译
宝塔
nginx
C#
IP
宝塔面板企业版免授权安装脚本
宝塔面板破解版
子比主题
在线截图生成器
网站源码
2023最新可用dai挂网源码
Root
累计撰写
160
篇文章
累计收到
182
条评论
今日撰写
1
篇文章
首页
栏目
闲聊
线报
WinForm
WinForm成品
WinForm源码
WinForm代码段
WEB
HTML代码
PHP代码
网站文章
网站源码
建站程序
Typecho
Typecho模板
Typecho插件
服务器运维面板
宝塔面板
网络安全
软件工具
技术教程
域名
自营程序
短链网DLW.IM
页面
统计
关于
骗子曝光
用户登录
登录
搜索到
2
篇与
winform窗体透明背景实现
的结果
2023-05-04
winform窗体透明背景实现
因为winform Form窗体的局限性,不允许设置背景色为transparent。所以不能实现透明背景。这里有一个取巧的方法(截Form后的背景)。首先来看下实现效果:想要实现半透明效果只要加个panel ,将panel设置为背景色透明,然后加个遮罩图片就可以了。以下附上实现代码:using System; using System.Drawing; using System.Windows.Forms; namespace WindowsTrans { public partial class Form1 : Form { private Color tr_color = Color.Transparent; private bool b_start = false; bool[] b_visible = null; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { SetBackgroundImageTransparent(); } private void SetBackgroundImageTransparent() { Point pt = this.PointToScreen(new Point(0, 0)); Bitmap b = new Bitmap(this.Width, this.Height); using (Graphics g = Graphics.FromImage(b)) { g.CopyFromScreen(pt, new Point(), new Size(this.Width, this.Height)); } this.BackgroundImage = b; } private void BeginSet() { tr_color = this.TransparencyKey; b_start = true; } private void Setting() { if (b_start) { b_visible = new bool[Controls.Count]; for (int i = 0; i < Controls.Count; i++) { b_visible[i] = Controls[i].Visible; Controls[i].Visible = false; } BackgroundImage = null; BackColor = Color.White; b_start = false; this.TransparencyKey = Color.White; } } private void EndSet() { SetBackgroundImageTransparent(); this.TransparencyKey = tr_color; for (int i = 0; i < Controls.Count; i++) { Controls[i].Visible = b_visible[i]; } b_start = false; } private void Form1_Resize(object sender, EventArgs e) { Setting(); } private void Form1_ResizeBegin(object sender, EventArgs e) { BeginSet(); } private void Form1_ResizeEnd(object sender, EventArgs e) { EndSet(); } private void Form1_Move(object sender, EventArgs e) { Setting(); } } }
2023年05月04日
3 阅读
0 评论
0 点赞
2021-12-25
winform窗体透明背景实现
因为winform Form窗体的局限性,不允许设置背景色为transparent。所以不能实现透明背景。这里有一个取巧的方法(截Form后的背景)。首先来看下实现效果: 想要实现半透明效果只要加个panel ,将panel设置为背景色透明,然后加个遮罩图片就可以了。 以下附上实现代码:using System; using System.Drawing; using System.Windows.Forms; namespace WindowsTrans { public partial class Form1 : Form { private Color tr_color = Color.Transparent; private bool b_start = false; bool[] b_visible = null; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { SetBackgroundImageTransparent(); } private void SetBackgroundImageTransparent() { Point pt = this.PointToScreen(new Point(0, 0)); Bitmap b = new Bitmap(this.Width, this.Height); using (Graphics g = Graphics.FromImage(b)) { g.CopyFromScreen(pt, new Point(), new Size(this.Width, this.Height)); } this.BackgroundImage = b; } private void BeginSet() { tr_color = this.TransparencyKey; b_start = true; } private void Setting() { if (b_start) { b_visible = new bool[Controls.Count]; for (int i = 0; i < Controls.Count; i++) { b_visible[i] = Controls[i].Visible; Controls[i].Visible = false; } BackgroundImage = null; BackColor = Color.White; b_start = false; this.TransparencyKey = Color.White; } } private void EndSet() { SetBackgroundImageTransparent(); this.TransparencyKey = tr_color; for (int i = 0; i < Controls.Count; i++) { Controls[i].Visible = b_visible[i]; } b_start = false; } private void Form1_Resize(object sender, EventArgs e) { Setting(); } private void Form1_ResizeBegin(object sender, EventArgs e) { BeginSet(); } private void Form1_ResizeEnd(object sender, EventArgs e) { EndSet(); } private void Form1_Move(object sender, EventArgs e) { Setting(); } } }
2021年12月25日
98 阅读
0 评论
0 点赞