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

推荐订阅源

I
InfoQ
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
博客园 - 聂微东
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
F
Fortinet All Blogs
H
Help Net Security
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
L
LangChain Blog
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium

博客园 - 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);
            }
        }