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

推荐订阅源

N
Netflix TechBlog - Medium
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
F
Fortinet All Blogs
D
Docker
博客园 - 司徒正美
腾讯CDC
Recent Announcements
Recent Announcements
The Cloudflare Blog
B
Blog RSS Feed
GbyAI
GbyAI
T
Tailwind CSS Blog
雷峰网
雷峰网
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志

博客园 - adi

C# new用法总结 TreeView ADD DEL - adi TreeView2Xml - adi - 博客园 xml节点删除修改 子页面关闭时刷新父页面 javascript + asp.net - adi ASP.NET 弹出对话框和页面之间传递值的经验总结 Oracle 9.2下的“System.Exception: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater” Oracle 10g ORA-12154: TNS: could not resolve the connect identifier specified 问题解决! sql游标 分组合并 No relevant source lines 关于Ajax 错误:'sys'未定义解决方法. 未能加载文件或程序集 system.web.extensions解决方法 要求使用 IIS 6.0 动态内容时 " HTTP 错误 404 - 文件或目录找 " 错误信息 VB.net与Media Player9.0嵌入式开发 企业中的Windows Media Services 流媒体 http://www.cnblogs.com/hmmcsdd/archive/2007/10/11/windowsmediasdjieshao.html 解决AJAX中使用UpdatePanel后再用Response.Write();等无法弹出对话框问题 3法
PictureBox
adi · 2008-09-10 · via 博客园 - adi

 private void InitGroupBox()
        {
            for (int k = 0; k < 16;k++ )
            {
                PictureBox pic = new PictureBox();
                int i = k % 4;
                int j = k / 4;
                pic.Name = k.ToString();
                pic.Top = 50 + j * 201;
                pic.Left = 50+i * 251;
                pic.Width = 250;
                pic.Height = 200;
                //pic.Visible = true;
                pic.Click  += new EventHandler(PictureBox_Click);
                pic.Paint += new PaintEventHandler(pictureBox_Paint);
                pic.BorderStyle = BorderStyle.FixedSingle;
                this.GroupPanel.Controls.Add(pic);
            }
        }
        private void PictureBox_Click(object sender, EventArgs e)
        {
            PictureBox p = (PictureBox)sender;
            if (p == old) return;

            if (old != null)
            {
                old.Width -= 10;
                old.Height -= 10;
                old.Location = new Point(old.Location.X + 5, old.Location.Y + 5);
            }

            old = p;
            p.Width += 10;
            p.Height += 10;
            p.Location = new Point(p.Location.X - 5, p.Location.Y - 5);
            p.BringToFront(); 
          
        }
        private void pictureBox_Paint(object sender, PaintEventArgs e)
        {
            PictureBox p = (PictureBox)sender;
            if (p == old)
            {
                Pen pp = new Pen(Color.Red);
                e.Graphics.DrawRectangle(pp, e.ClipRectangle.X, e.ClipRectangle.Y, e.ClipRectangle.X + e.ClipRectangle.Width - 1, e.ClipRectangle.Y + e.ClipRectangle.Height - 1);
            }
        }