| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 326 人关注过本帖
标题:C#一点问题
只看楼主 加入收藏
xiaoshou520
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-2-23
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
C#一点问题
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        static int x = 200;
        static int y = 200;
        static int count = 0;
        private void button1_click(object sender, EventArgs e)
        {
            Form1 form2 = new Form1();
            form2.FormBorderStyle = FormBorderStyle.Fixed3D;
            form2.Cursor = Cursor.hand;
            form2.SetDesktopBounds(x, y);
            form2.Visible = true;
            x += 30;
            y += 30;
            this.Activate();
            this.button1.enabled = false;
            Label1.text = "新窗体的坐标(“+X+”,“+Y+”)";
            label2.text = "这是第" + count + "个窗体";
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            count += 1;
        }
        private void form1_formclosed(object sender, FormClosedEventArgs e)
        {
            count -= 1;
        }
        private void button2_click(object sender, EventArgs e)
        {
            this.Hide();
        }
    }
}
运行的时候出错,我做一个窗体的设计界面

搜索更多相关主题的帖子: private public count 
2010-09-27 08:57
c1_wangyf
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:7
帖 子:665
专家分:2832
注 册:2010-5-24
收藏
得分:0 
是什么意思,哪里出现的错误,提示是什么啊?!
2010-09-27 14:39
bygg
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:乖乖的心中
等 级:版主
威 望:241
帖 子:13555
专家分:3076
注 册:2006-10-23
收藏
得分:20 
程序代码:
 static int x = 200;
        static int y = 200;
        static int count = 0;
        private void button1_click(object sender, EventArgs e)
        {
            Form1 form2 = new Form1();
            form2.FormBorderStyle = FormBorderStyle.Fixed3D;
            form2.Cursor = Cursors.Hand;
            form2.SetDesktopBounds(x, y, 200, 200);
            form2.Visible = true;
            x += 30;
            y += 30;
            this.Activate();
            this.button1.Enabled = false;
            label1.Text = "新窗体的坐标(" + x + "," + y + "";
            label2.Text = "这是第" + count + "个窗体";
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            count += 1;
        }
        private void Form2_formclosed(object sender, FormClosedEventArgs e)
        {
            count -= 1;
        }
        private void button2_click(object sender, EventArgs e)
        {
            this.Hide();
        }

飘过~~
2010-09-27 16:03
快速回复:C#一点问题
数据加载中...
 
   



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

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