zoukankan
html css js c++ java
在WM中画个带有边框的Panel
想在ppc上类似的带有边框的Panel(美观嘛),可惜WM自带的Panel有没有这项属性,于是自己继承封装了一个,很简单滴
using
System;
using
System.Collections.Generic;
using
System.Text;
using
System.Windows.Forms;
using
System.Drawing;
using
System.Drawing.Drawing2D;
namespace
DrawPanel
{
public
class
DrawPanel:Panel
{
protected
override
void
OnPaint(PaintEventArgs e)
{
base
.OnPaint(e);
Graphics g
=
e.Graphics;
Pen pen
=
new
Pen(_borderColor, _borderWidth);
pen.DashStyle
=
_borderDashStyle;
g.DrawRectangle(pen,e.ClipRectangle.X,e.ClipRectangle.Y, e.ClipRectangle.Width
-
1
, e.ClipRectangle.Height
-
1
);
}
Color _borderColor
=
Color.Black;
/**/
///
<summary>
///
获取或设置边框颜色
///
</summary>
public
virtual
Color BorderColor
{
get
{
return
_borderColor; }
set
{ _borderColor
=
value ; }
}
float
_borderWidth
=
1f;
/**/
///
<summary>
///
获取或设置边框的宽度
///
</summary>
public
virtual
float
BorderWidth
{
get
{
return
_borderWidth; }
set
{ _borderWidth
=
value; }
}
DashStyle _borderDashStyle
=
DashStyle.Solid;
/**/
///
<summary>
///
获取或设置边框的样式
///
</summary>
public
DashStyle BorderDashStyle
{
get
{
return
_borderDashStyle; }
set
{ _borderDashStyle
=
value; }
}
}
}
查看全文
相关阅读:
启动 YARN 并运行 MapReduce 程序(伪分布式模式)
启动 HDFS 并运行 MapReduce 程序(伪分布式模式)
简单计算器(stack)
Linux定时发邮件脚本
HttpClient接口调用-客户端
获取时间字符串
Visual Assist代码高亮突然失效
批量快速生成员工文件夹工具
日语学习笔记整理(汉译日)
有关使用PLSQL Developer时出现报错ora-12514解决的方法
原文地址:https://www.cnblogs.com/qiba78/p/1233149.html
最新文章
Mysql创建定时任务
java连接MySQL时报错,unable to find valid certification path to requested target
mysql重设密码及允许远程访问
nginx系统学习【命令行参数、配置文件、SSL开启、负载均衡、请求处理过程】
centos7安装nginx
布隆过滤器原理
Shiro中@RequiresRoles注解相关参数说明
Mysql联表update数据
Linux添加定时任务提示权限不够
shell脚本读取命令行的参数
热门文章
golang开发:http请求redirect的问题
Segment Routing笔记(一)
00
集群启动/停止方式总结
群起集群
SSH 无密登录配置
从 scp 到 xsync 脚本
设置防火墙(启动/关闭)
配置日志聚集(伪分布式模式)
配置历史服务器(伪分布式模式)
Copyright © 2011-2022 走看看