惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - 什么都不知道

DataSet的Xml序列化问题 VB.NET的一个小问题 Access is denied的问题 - 什么都不知道 存储过程output参数问题 SQL Server的效率? datagrid刷新问题 使用Visio DrawingControl的应用开发(补) WinForm下TextBox的数据绑定和更新 使用Radio按钮选择DataGrid行 如何在运行时加载不处于应用程序目录下的assembly 使用VSA给程序加上脚本支持 删除所有Windows组件 在ASP.NET中嵌入wml标记 c#中动态装载dll 处理大型xml文件 RedirectToMobilePage的问题 使用Visio 2003 Drawing Control开发应用(3)(4) 使用Visio 2003 Drawing Control开发应用(2) 使用Visio 2003 Drawing Control开发应用(1)
突起效果的Label
什么都不知道 · 2004-10-12 · via 博客园 - 什么都不知道

现成的Winform下的Label控件的三种BorderStyle没有突起效果的,None, FixedSingle, Fixed3D。
要做个突起效果的,就继承一个Label来做。里面加上:

        protected override CreateParams CreateParams
        
{
            
get
            
{
                CreateParams cp 
= base.CreateParams;
                cp.ExStyle 
&= (~NativeMethods.WS_EXCLIENTEDGE);
                cp.Style 
&= (~NativeMethods.WS_BORDER);

                
switch(borderStyle)
                
{
                    
case BorderStyle.Fixed3D:
                        cp.ExStyle 
|= NativeMethods.WS_EXCLIENTEDGE;
                        
break;
                    
case BorderStyle.FixedSingle:
                        cp.Style 
|= NativeMethods.WS_BORDER;
                        
break;
                }

                
return cp;
            }

        }


        
public override BorderStyle BorderStyle
        
{
            
get
            
{
                
return borderStyle;
            }

            
set
            
{
                
if(borderStyle != value)
                
{
                    
if(!Enum.IsDefined(typeof(BorderStyle), value))
                    
{
                        
throw new InvalidEnumArgumentException("value", (int)value, typeof(BorderStyle));
                    }

                    borderStyle 
= value;
                    UpdateStyles();
                }

            }

        }

看结果,上面那个就是突起的Label
(代码就是MSDN里面那个创建有边框的UserControl的代码,呵呵,只是给不知道的人们看看,我上午就还不知道着呢)