.NET环境下TextBox和RichTextBox透明背景色
来源:互联网 发布:nginx 4层负载均衡 编辑:程序博客网 时间:2024/05/19 23:14
文本框控件不支持透明的背景色
public class MyTextBox : TextBox
{
public MyTextBox()
{
this.SetStyle(ControlStyles.SupportsTransparentBackC olor, true);
}
}
1. 创建一个窗体,无边框,TrancsparencyKey设置为跟TextBox一样;
2. 窗体上放一个TextBox,Dock属性设置为fill;
3. 在主窗体上放置一个Label,设置成透明;
4. 鼠标点击Label时,将自己做的窗体show出来,并且将label隐藏;
5. 焦点离开TextBox时,将TextBox的内容复制给Label。关闭无框窗体,显示label;
6. 其他细节就自己琢磨吧,比如鼠标外观啦,Tab键控制焦点移动啦之类。
总结
开源控件
AlphaBlendTextBox - A transparent/translucent textbox for .NET
Alpha Blended (Transparent Capable) TextBox and RichTextBox
另外:
C#中button透明,无边线框,但是点击透明部分能实现它的功能~~~· 谢谢
答:按钮的FlatStyle属性改成Flat.加一个button1.BackColor=Color.Transparent;(或者加this.button1.FlatStyle=FlatStyle.Flat;button1.BackColor=Color.Transparent;
- .NET环境下TextBox和RichTextBox透明背景色
- 解决winfrom下TextBox不支持透明背景色
- Vb.net 控件背景色透明设置BackColor 和Parent
- c# 透明textbox,透明richtextbox
- 画笔和透明背景色的画笔
- BufferedImage 和 Graphics2D 画图,背景色透明
- Label背景色透明
- 背景色透明rgba
- IE8 背景色透明
- activity 背景色 透明
- jeasyui.textbox,修改背景色
- android设置背景色为全透明和半透明
- Qt:QDockWidget和QScrollArea背景色设置为透明
- Iframe设置透明背景色
- 设置iframe背景色透明
- JS背景色图片透明
- 设置网页背景色透明
- android button 透明背景色
- Rails宝典之第八式: layout与content_for
- EFFECTIVE JAVA 笔记
- C语言设计之 学生信息管理系统
- hdoj 1330
- Asp.net MVC3 关于@Html中ListBox、DropDownList使用
- .NET环境下TextBox和RichTextBox透明背景色
- error C2491 definition of dllimport static data member not allowed(不允许dllimport静态数据成员的定义)
- LINUX系统学习笔记07-磁盘配额与磁盘阵列
- 正则表达式备忘-----------转载自http://www.cnblogs.com/KissKnife/archive/2008/03/23/1118423.html
- C# Dictionary 通过Keys获取Values
- 最新历史版本 :LINUX KERNEL 配置编译中文指南
- autohotkey倒关机
- 算法系列之九:计算几何与图形学有关的几种常用算法(二)
- android控件27 File