| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 557 人关注过本帖
标题:求助 各位 朋友(谢谢)
只看楼主 加入收藏
iwanttostudy111
Rank: 1
来 自:青岛
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-9-22
收藏
 问题点数:0 回复次数:1 
求助 各位 朋友(谢谢)
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication4 {
    public partial class Form3 : Form {
        public Form3() {
            InitializeComponent();
        }

        private void textBox1_Validating(object sender, CancelEventArgs e) {
            if (this.textBox1.Text == "")
                this.errorProvider1.SetError(this.textBox1, "输入第1个");//指定在那个空间旁边显示提示
            else
                this.errorProvider1.SetError(this.textBox1, null);//清除掉此控件旁边的提示
        }

        private void textBox2_Validating(object sender, CancelEventArgs e) {
            if (this.textBox2.Text == "")
                this.errorProvider1.SetError(this.textBox2, "输入第2个");
            else
                this.errorProvider1.SetError(this.textBox2, null);
        }
    }
}
我不看懂 这具体的要求,运行不通。。。。。。。。。谢谢了
搜索更多相关主题的帖子: 朋友 
2008-10-16 20:58
yaybig
Rank: 1
来 自:广西玉林
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-10-13
收藏
得分:0 
textBox1_Validating(object sender, CancelEventArgs e)函数是正在验证textBox1控件时执行。主要作用是验证textBox1.text内容是不是符合要求。
textBox2_Validating(object sender, CancelEventArgs e)作用同上。
2008-10-16 21:32
快速回复:求助 各位 朋友(谢谢)
数据加载中...
 
   



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

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