| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 398 人关注过本帖
标题:谁能给解释下这段代码?怎么都看不懂,最好加个注释
只看楼主 加入收藏
baijunying11
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-1-20
收藏
 问题点数:0 回复次数:2 
谁能给解释下这段代码?怎么都看不懂,最好加个注释
static int frmLastWidth = 0;
        static int frmLastHeight = 0;
        static int frmWidth;
        static int frmHeight;
        static bool frmIsResizing = false;
        System.Drawing.Rectangle frmRectangle = new System.Drawing.Rectangle();
        private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
         {
             if (e.Button == MouseButtons.Left)
             {
                 int sizeageX=(MousePosition .X -this.Location .X );
                 int sizeageY = (MousePosition.Y - this.Location.Y);
                 if (sizeageX < 240)
                     sizeageX = 240;
                 if (sizeageY < 100)
                     sizeageY = 100;
                 frmWidth = sizeageX;
                 frmHeight = sizeageY;
                 if (frmLastWidth == 0)
                     frmLastWidth = frmWidth;
                 if (frmLastHeight == 0)
                     frmLastHeight = frmHeight;
                 if (frmIsResizing)
                 {
                     frmRectangle.Location = new System.Drawing.Point(this.Left, this.Top);
                     frmRectangle.Size = new System.Drawing.Size(frmLastWidth, frmLastHeight);
                 }
                 frmIsResizing = true;
                 ControlPaint.DrawReversibleFrame(frmRectangle, Color.Empty, System.Windows.Forms.FrameStyle.Thick);
                 frmLastWidth = frmWidth;
                 frmLastHeight = frmHeight;
                 frmRectangle.Location = new System.Drawing.Point(this.Left, this.Top);
                 frmRectangle.Size = new System.Drawing.Size(frmLastWidth, frmLastHeight);
                 ControlPaint.DrawReversibleFrame(frmRectangle, Color.Empty, System.Windows.Forms.FrameStyle.Thick);
 
             }
搜索更多相关主题的帖子: void private false 最好 
2012-03-11 21:08
baijunying11
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-1-20
收藏
得分:0 
没人会吗?
2012-03-12 09:40
hellovfp
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:禁止访问
威 望:30
帖 子:2976
专家分:7697
注 册:2009-7-21
收藏
得分:0 
自己去翻System.Drawing 绘图部分,学程序的,别人的代码都懒得钻研是没法学好的。

我们都在路上。。。。。
2012-03-12 10:58
快速回复:谁能给解释下这段代码?怎么都看不懂,最好加个注释
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019518 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved