| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 516 人关注过本帖
标题:网上找来的一段程序,手动按提示改了几次不行,求大神指点
只看楼主 加入收藏
tameimeide
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2013-3-31
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:1 
网上找来的一段程序,手动按提示改了几次不行,求大神指点
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;

namespace xxxxxx
{
 public partial class Form1 : Form
    {
        private = null;
        public Form1()
        {
            //初始化窗体中的各个组件  
            InitializeComponent();
        }
        protected override void Dispose(bool disposing)
        {
            //清除程序中使用过的资源  
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
        private void InitializeComponent()
        {
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
            this.ClientSize = new System.Drawing.Size(292, 273);
            this.Name = "Form1";
            this.Text = "C#处理键盘事件!";
            //为按键的按动定义一个事件处理过程"Form1_KeyUp"
            this.KeyUp += new KeyEventHandler(this.Form1_KeyUp);
        }
        static void Main()
        {
            Application.Run(new Form1());
        }
        //显示你所按动的按键名称
        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            MessageBox.Show(e.KeyCode.ToString(), "您所按动的健为:");
        }
    }
}
搜索更多相关主题的帖子: private public xxxxxx null 
2013-07-15 23:49
qqxihuannilo
Rank: 2
等 级:论坛游民
帖 子:3
专家分:27
注 册:2013-7-16
收藏
得分:20 
protected override void Dispose(bool disposing)
        {
            //清除程序中使用过的资源  
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
        private void InitializeComponent()
        {
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
            this.ClientSize = new System.Drawing.Size(292, 273);
            this.Name = "Form1";
            this.Text = "C#处理键盘事件!";
            //为按键的按动定义一个事件处理过程"Form1_KeyUp"
            this.KeyUp += new KeyEventHandler(this.Form1_KeyUp);
        }
        static void Main()
        {
            Application.Run(new Form1());
        }
        //显示你所按动的按键名称
        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            MessageBox.Show(e.KeyCode.ToString(), "您所按动的健为:");
        }
把这一段写在Form1.designer.cs里面,不要写在Form1.cs就行啦
2013-07-16 19:57
快速回复:网上找来的一段程序,手动按提示改了几次不行,求大神指点
数据加载中...
 
   



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

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