public class MyGroupBox : GroupBox
{
    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);
        ControlPaint.DrawBorder(e.Graphics, ClientRectangle,
                                     Color.Black, BORDER_SIZE, ButtonBorderStyle.Inset,
                                     Color.Black, BORDER_SIZE, ButtonBorderStyle.Inset,
                                     Color.Black, BORDER_SIZE, ButtonBorderStyle.Inset,
                                     Color.Black, BORDER_SIZE, ButtonBorderStyle.Inset);
    }
}

转自:Codeproject

Draw a Border around any C# Winform Control的更多相关文章

  1. WinForm Control - DataGridView

    http://blog.csdn.net/fangxing80/article/details/1561011 .NET 2.0 - WinForm Control - DataGridView 编程 ...

  2. DotNetBar ItemPanel添加WinForm Control

    int itemcount = 20; Random rd = new Random(); itemPanel1.Items.Clear(); for (int i = 0; i < itemc ...

  3. WinForm Control.Invoke&Control.BeginInvoke异步操作控件实例

    参考:http://www.cnblogs.com/yuyijq/archive/2010/01/11/1643802.html 效果图: 实例(实验)代码: using System; using ...

  4. A GDI+ Based Character LCD Control

    This is a renew. A GDI+ Based Character LCD Control by Conmajia Character liquid crystal display (LC ...

  5. 📟 Character Liquid Crystal Display Control (English)

    A replica CLCD module control. Initiated on May 5, 2012 Updated on Feb 21, 2017 Copyright 2012-2017 ...

  6. Java基础之在窗口中绘图——移动曲线的控制点(CurveApplet 3 moving the control points)

    Applet程序. import javax.swing.*; import java.awt.*; import java.awt.geom.*; import javax.swing.event. ...

  7. (转)使用Custom Draw实现ListCtrl的重绘

    使用Custom Draw实现ListCtrl的重绘   common control 4.7版本介绍了一个新的特性叫做Custom Draw,这个名字显得模糊不清,让人有点摸不着头脑,而且MSDN里 ...

  8. Java基础之在窗口中绘图——显示曲线的控制点(CurveApplet 2 displaying control points)

    Applet程序. import javax.swing.*; import java.awt.*; import java.awt.geom.*; @SuppressWarnings("s ...

  9. WinForm GDI+自定义控件总结(一)

    前言 由于项目的原因好久没写博客了,也正是项目的原因开始系统的学习WinForm,从而接触到自定义控件的开发.自定义控件的开发有一定的难度,对开发者要求比较高,需要了解Windows运行的机制,熟悉w ...

随机推荐

  1. Android Studio 使用genymotion 模拟器运行app时 提示找不到任何设备

    原因是使用了genymotion 默认的Android toos .打开genymotion  选择设置  ADB  使用自己的SDKtools 选择Android Studio 使用的SDK位置就行 ...

  2. (转)iphone数据存储之-- Core Data的使用

    原文:http://www.cnblogs.com/xiaodao/archive/2012/10/08/2715477.html iphone数据存储之-- Core Data的使用(一)   一. ...

  3. 一段显示隐藏列表HTML代码

    一段显示隐藏列表HTML代码, 技巧在于把页面上的元素(“返回首页”)和控制显示/隐藏的元素(id=navs-menu)放在一个共同的div上,并在该div上绑定onmouseover和onmouse ...

  4. UNIX,基础知识,文件IO,文件和目录

    2015.1.27星期二,早晨阴天,中午下雪了今天上午老师不上课,程序语句,记一下:main(void){ int c; while((c = getc(stdin)) != EOF) if(putc ...

  5. VM命令行操作

    vim-cmd  vmsvc/getallvms /查看ESXi上所有虚拟机信息,主要查看虚拟机对应的ID号 vim-cmd vmsvc/power.on <VM ID>  /对应ID的虚 ...

  6. Newspaper Headline_set(upper_bound)

    Description A newspaper is published in Walrusland. Its heading is s1, it consists of lowercase Lati ...

  7. Unity3D ShaderLab 模拟纹理运动

    Unity3D ShaderLab 模拟纹理运动 这一篇,我们要说到着色器上的uv贴图的滚动效果,这样的场景可以用在河流,瀑布,熔岩等效果.算是创建纹理动画的基础技术之一. 所以 准备一个新的着色器文 ...

  8. 解决input之间的空隙

    <!doctype html> <html> <head> <meta charset="UTF-8"> <meta name ...

  9. iOS开发环境C语言基础 运算符和表达式

    1 年龄判断程序 1.1 问题 本案例需要使用交互的方式判断年龄的范围:用户从控制台输入一个年龄,由程序判断该年龄是否在18~50岁之间.程序交互过程如图-1所示: 图-1 1.2 步骤 实现此案例需 ...

  10. 【题解】【数组】【Prefix Sums】【Codility】Genomic Range Query

    A non-empty zero-indexed string S is given. String S consists of N characters from the set of upper- ...