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

推荐订阅源

The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
T
Threatpost
WordPress大学
WordPress大学
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
PCI Perspectives
PCI Perspectives
T
The Exploit Database - CXSecurity.com
Y
Y Combinator Blog
雷峰网
雷峰网
爱范儿
爱范儿
The Hacker News
The Hacker News
Last Week in AI
Last Week in AI
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
S
Securelist
宝玉的分享
宝玉的分享
L
LangChain Blog
O
OpenAI News
AI
AI
P
Privacy International News Feed
L
LINUX DO - 最新话题
D
DataBreaches.Net
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs
罗磊的独立博客
M
MIT News - Artificial intelligence
Security Archives - TechRepublic
Security Archives - TechRepublic
月光博客
月光博客
博客园 - 【当耐特】
T
Tailwind CSS Blog
C
Cybersecurity and Infrastructure Security Agency CISA
H
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
Jina AI
Jina AI
The Last Watchdog
The Last Watchdog
K
Kaspersky official blog
Webroot Blog
Webroot Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog

博客园 - dn

[2008年]毕业论文格式要求 《面向.NET的XML程序设计》MAC模拟题 《基于C#的Windows应用程序设计》MCP认证考试模拟题 第六章课后习题及答案 第五章课后习题及答案 第四章课后习题及答案 毕业设计论文封面模板 在C#程序设计中使用Win32 API .NET中常用的连接字符串 第三章课后习题和答案 第三章例题:文件许可 第三章例题:为控件添加设计时支持 第三章例题:重载控件属性 毕业论文格式 第二章课后习题及答案 第二章例题:验证处理 第二章例题:动态添加控件 [2007年]毕业设计:bluehill人事管理系统 快速导航
第三章例题:自定义控件
dn · 2007-03-31 · via 博客园 - dn

对教材p120部分创建控件进行演示

 1using System;
 2using System.Drawing;
 3using System.ComponentModel;
 4using System.Windows.Forms;
 5
 6namespace my_control
 7{
 8    //所有控件必须派生自Control类
 9    public class CustomControl : System.Windows.Forms.Control 
10    {
11        //重载控件的OnPaint方法
12        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
13        {
14            //绘制字符串
15            e.Graphics.DrawString("Written with GDI+ on OnPaint event"
16                new Font("Arial",12), new SolidBrush(Color.Red), 00);
17        }

18    }

19}

 完整控件代码和控件测试程序下载:my_control.rar