标题:谁能给解释下这段代码?怎么都看不懂,最好加个注释
取消只看楼主
baijunying11
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-1-20
 问题点数:0 回复次数:1 
谁能给解释下这段代码?怎么都看不懂,最好加个注释
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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-362867-1-1.html




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

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