| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2187 人关注过本帖
标题:C#代码翻译..!
取消只看楼主 加入收藏
zhou363667565
Rank: 1
来 自:湖南株洲
等 级:新手上路
帖 子:12
专家分:0
注 册:2008-10-26
收藏
 问题点数:0 回复次数:1 
C#代码翻译..!
这段代码对我很重要,我们就快交项目了.! 我想完成这个功能,!  请帮我解释一下, 别且写上注释,!   先谢谢各位了.1!

以下是一个右下角窗体 ,缓慢移动上升或下降的代码:

using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        int x = 0;  
        int y = 0;
        public Form1()
        {
            InitializeComponent();
            Form.CheckForIllegalCrossThreadCalls = false;
             x = Screen.PrimaryScreen.Bounds.Width - this.Width;
             y = Screen.PrimaryScreen.Bounds.Height;            
        }


        //窗体加载事件;
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Location = new Point(x, y);
            timer1.Start();   //启用计时器;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            y = y - 10;
            this.Location = new Point(x, y);
            if (y <= Screen.PrimaryScreen.Bounds.Height - this.Height - 30)
            {
                timer1.Stop();
                System.Threading.Thread.Sleep(5000);
                this.Close();
            }
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            while (true)
            {
                y = y + 10;
                this.Location = new Point(x, y);
                if (y >= Screen.PrimaryScreen.Bounds.Height)
                    break;
                System.Threading.Thread.Sleep(100);
            }
        }

    }
}
搜索更多相关主题的帖子: 注释 
2008-10-26 16:26
zhou363667565
Rank: 1
来 自:湖南株洲
等 级:新手上路
帖 子:12
专家分:0
注 册:2008-10-26
收藏
得分:0 
o(∩_∩)o...。

谢谢大家,热心的回答.!    特别感谢米老鼠 . 注释,  写的很详细..!  同时,也感谢所有的回答着.!
2008-10-27 15:48
快速回复:C#代码翻译..!
数据加载中...
 
   



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

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