| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 686 人关注过本帖
标题:自定義圓
只看楼主 加入收藏
adair
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:250
专家分:0
注 册:2005-9-3
收藏
 问题点数:0 回复次数:0 
自定義圓

Private bg As Color Public Property bgcolor() As Color Get bgcolor = bg End Get Set(ByVal Value As Color) bg = Value End Set End Property

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)

Dim graphics As Graphics = e.Graphics Dim penWidth As Integer = 1 Dim pen As Pen = New Pen(Color.Black, 1)

Dim fontHeight As Integer = 10 Dim font As Font = New Font("Arial", fontHeight)

Dim brush As SolidBrush = New SolidBrush(bg) graphics.FillEllipse(brush, 0, 0, Width, Height) Dim textBrush As SolidBrush = New SolidBrush(Color.Black)

graphics.DrawEllipse(pen, CInt(penWidth / 2), _ CInt(penWidth / 2), Width - penWidth, Height - penWidth)

graphics.DrawString(Text, font, textBrush, penWidth, _ Height / 2 - fontHeight) End Sub

2005-09-21 18:29
快速回复:自定義圓
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016128 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved