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

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 阮

Database access assembly build program. - 阮 Remoting: Server encountered an internal error. - 阮 昨天忽然发现被加到training团队中了,遂来发一篇。 利用Brush修改图片,并写入Response一例(网上BBS中贴可变文字图片的例子)。 Avalon 与 3D。 关于QQ的临时消息 Google Search for dot net nuke. 初识 Avalon 通过程序控制Windows传真发送。 VRML Merry Chirstmas. 继续昨天的问题。 What's wrong? 构建安全的 ASP.NET 应用程序。(转) 检测Win Form Datagrid点击cell值的代码,from msdn。 Google search for DNN 终于写完了。 DataGrid不能绑定Field? 试了试Dot Net Nuke还真爽。 取得天气的WEB地址,weather.com
终于,从System.Windows.Forms.Control继承了一下。
· 2004-11-17 · via 博客园 - 阮

一个好网页,不错,聊天记录,记下。

前天发的这个随笔,里面记载了一些资源,由于真正接触.NET(Win Form?)还是比较晚,所以目前为止还是笨鸟,还是后飞

仔细看了里面一些资源,终于做出来了第一个Control,庆祝一下吧

using System;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Design;

namespace DividerPanel
{
    
/// <summary>
    
/// My First Control.
    
/// </summary>

    [ToolboxItem(true)]
    [ToolboxBitmap(
typeof(MyFirstControl))]
    
public class MyFirstControl : System.Windows.Forms.Control
    
{

        
private System.Drawing.Drawing2D.GraphicsPath graphicsPath = new GraphicsPath(System.Drawing.Drawing2D.FillMode.Alternate);

        
private Color backColor = Color.Black;

        
public MyFirstControl()
        
{
            
this.graphicsPath.AddPolygon(new Point[]{
                                                
new Point(100),
                                                
new Point(1010),
                                                
new Point(010),
                                                
new Point(090),
                                                
new Point(1090),
                                                
new Point(10100),
                                                
new Point(190100),
                                                
new Point(19090),
                                                
new Point(20090),
                                                
new Point(20010),
                                                
new Point(19010),
                                                
new Point(1900)
                                            }
);

            
this.Region = new Region(graphicsPath);
        }


        
private void InitializeComponent()
        
{
        }


        
protected override void OnPaint(PaintEventArgs e)
        
{
            LinearGradientBrush b 
= new LinearGradientBrush(this.ClientRectangle,
                
this.backColor, this.backColor, 0false);
              
            e.Graphics.FillRectangle(b, 
this.ClientRectangle);
        }


        
protected override void OnGotFocus(EventArgs e)
        
{
            
base.OnGotFocus (e);
            
this.backColor = Color.Red;
            
this.Invalidate();
        }


        
protected override void OnLostFocus(EventArgs e)
        
{
            
base.OnLostFocus (e);
            
this.backColor = Color.Black;
            
this.Invalidate();
        }


        
protected override void OnClick(EventArgs e)
        
{
            
base.OnClick (e);

            
this.Focus();
        }


    }

}