• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.ErrorProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.ErrorProvider的典型用法代码示例。如果您正苦于以下问题:C# ErrorProvider类的具体用法?C# ErrorProvider怎么用?C# ErrorProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ErrorProvider类属于System.Windows.Forms命名空间,在下文中一共展示了ErrorProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PolicyDesignerErrorProvider

 public PolicyDesignerErrorProvider(
     Interfaces.IErrorProviderCollection errorProviderCollection,
     ErrorProvider errorProvider)
 {
     m_parentCollection = errorProviderCollection;
     m_errorProvider = errorProvider;
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:PolicyDesignerErrorProvider.cs


示例2: MaskedTextBoxTextEditorDropDown

 public MaskedTextBoxTextEditorDropDown(MaskedTextBox maskedTextBox)
 {
     this.cloneMtb = MaskedTextBoxDesigner.GetDesignMaskedTextBox(maskedTextBox);
     this.errorProvider = new ErrorProvider();
     ((ISupportInitialize) this.errorProvider).BeginInit();
     base.SuspendLayout();
     this.cloneMtb.Dock = DockStyle.Fill;
     this.cloneMtb.TextMaskFormat = MaskFormat.IncludePromptAndLiterals;
     this.cloneMtb.ResetOnPrompt = true;
     this.cloneMtb.SkipLiterals = true;
     this.cloneMtb.ResetOnSpace = true;
     this.cloneMtb.Name = "MaskedTextBoxClone";
     this.cloneMtb.TabIndex = 0;
     this.cloneMtb.MaskInputRejected += new MaskInputRejectedEventHandler(this.maskedTextBox_MaskInputRejected);
     this.cloneMtb.KeyDown += new KeyEventHandler(this.maskedTextBox_KeyDown);
     this.errorProvider.BlinkStyle = ErrorBlinkStyle.NeverBlink;
     this.errorProvider.ContainerControl = this;
     base.Controls.Add(this.cloneMtb);
     this.BackColor = SystemColors.Control;
     base.BorderStyle = BorderStyle.FixedSingle;
     base.Name = "MaskedTextBoxTextEditorDropDown";
     base.Padding = new Padding(0x10);
     base.Size = new Size(100, 0x34);
     ((ISupportInitialize) this.errorProvider).EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:MaskedTextBoxTextEditorDropDown.cs


示例3: DateTimePickerPresentation

        /// <summary>
        /// Initializes a new instance of the 'DateTimePickerPresentation' class.
        /// </summary>
        /// <param name="maskedTextBox">.NET MaskedTextBox reference.</param>
        /// <param name="dateTimePicker">.NET DateTimePicker reference.</param>
        public DateTimePickerPresentation(MaskedTextBox maskedTextBox, DateTimePicker dateTimePicker)
        {
            mMaskedTextBoxIT = maskedTextBox;
            mDateTimePickerIT = dateTimePicker;
            if (mMaskedTextBoxIT != null)
            {
                // Create and configure the ErrorProvider control.
                mErrorProvider = new ErrorProvider();
                mErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

                // Link MaskedTextBox control events.
                mMaskedTextBoxIT.GotFocus += new EventHandler(HandleMaskedTextBoxITGotFocus);
                mMaskedTextBoxIT.LostFocus += new EventHandler(HandleMaskedTextBoxITLostFocus);
                mMaskedTextBoxIT.TextChanged += new EventHandler(HandleMaskedTextBoxITTextChanged);
                mMaskedTextBoxIT.EnabledChanged += new EventHandler(HandleMaskedTextBoxITEnabledChanged);
                mMaskedTextBoxIT.KeyDown += new KeyEventHandler(HandleMaskedTextBoxITKeyDown);
            }

            if (dateTimePicker != null)
            {
                mDateTimePickerIT.Enter += new System.EventHandler(HandleDateTimePickerITEnter);
                mDateTimePickerIT.KeyUp += new System.Windows.Forms.KeyEventHandler(HandleDateTimePickerITKeyUp);
                mDateTimePickerIT.DropDown += new System.EventHandler(HandleDateTimePickerITDropDown);
                mDateTimePickerIT.CloseUp += new System.EventHandler(HandleDateTimePickerCloseUp);
            }
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:31,代码来源:DateTimePickerPresentation.cs


示例4: UserInfoManager

        public UserInfoManager()
        {
            InitializeComponent();
            _errorProvider = new ErrorProvider();

            //lblUserid.Text = "【 " + CurrentUser.Instance.UserName + " 】";
        }
开发者ID:ischool-desktop,项目名称:SchoolCore,代码行数:7,代码来源:UserInfoManager.cs


示例5: frmPreferences

        public frmPreferences()
        {
            InitializeComponent();

            foreach (Form form in Application.OpenForms)
            {
                if (form.Name == "frmMain")
                {
                    frm = ((frmMain)form);
                    break;
                }
            }

            wsrv.PreferencesSetCompleted += new krw.PreferencesSetCompletedEventHandler(PreferencesSetCompleted);
            wsrv.AdminPwSetCompleted += new krw.AdminPwSetCompletedEventHandler(AdminPwSetCompleted);
            wsrv.WatermarkStatusGetCompleted += new krw.WatermarkStatusGetCompletedEventHandler(WatermarkStatusGetCompleted);
            wsrv.WatermarkStatusSetCompleted += new krw.WatermarkStatusSetCompletedEventHandler(WatermarkStatusSetCompleted);
            wsrv.SpecRightClickGetCompleted += new krw.SpecRightClickGetCompletedEventHandler(SpecRightClickGetCompleted);
            wsrv.SpecRightClickSetCompleted += new krw.SpecRightClickSetCompletedEventHandler(SpecRightClickSetCompleted);
            wsrv.WebsiteTitlesGetCompleted += new krw.WebsiteTitlesGetCompletedEventHandler(WebsiteTitlesGetCompleted);
            wsrv.WebsiteTitlesChangeCompleted += new krw.WebsiteTitlesChangeCompletedEventHandler(WebsiteTitlesChangeCompleted);
            wsrv.ScrollTextGetCompleted += new krw.ScrollTextGetCompletedEventHandler(ScrollTextGetCompleted);
            wsrv.ScrollTextChangeCompleted += new krw.ScrollTextChangeCompletedEventHandler(ScrollTextChangeCompleted);
            wsrv.LogoUploadCompleted += new krw.LogoUploadCompletedEventHandler(LogoUploadCompleted);
            wsrv.LogoDownloadCompleted += new krw.LogoDownloadCompletedEventHandler(LogoDownloadCompleted);
            wsrv.GoogleAllCompleted += new krw.GoogleAllCompletedEventHandler(GoogleAllCompleted);
            wsrv.GoogleAddCompleted += new krw.GoogleAddCompletedEventHandler(GoogleAddCompleted);
            wsrv.GoogleEditCompleted += new krw.GoogleEditCompletedEventHandler(GoogleEditCompleted);
            wsrv.GoogleEraseCompleted += new krw.GoogleEraseCompletedEventHandler(GoogleEraseCompleted);

            errProvider = new ErrorProvider();

            this.dgvLogoTitles.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178)));
        }
开发者ID:Siadatian,项目名称:kermanshahchhto.ir,代码行数:34,代码来源:Preferences.cs


示例6: DataWraper

 public DataWraper(Type tableName, BindingSource componentId, ErrorProvider errorProvider)
 {
     errorProvider1 = errorProvider;
     
     bindingSourceMain = componentId;
     bindingSourceMain.PositionChanged += bindingSourceMain_PositionChanged;
     InitializeComponent();
     WrapperBindingSource.PositionChanged += WrapperBindingSource_PositionChanged;
     WrapperBindingSource.DataSource = tableName.GetType();
     //Type yy = tableName.GetType();
     Text = tableName.Name + "s";
     dataTableAdaptor = new MySqlTableAdaptor(tableName);
     dataTable = dataTableAdaptor.GetTable();
     WrapperBindingSource.DataSource = dataTable;
     errorProvider1.DataSource = WrapperBindingSource;
     if (componentId.Current != null)
     {
         WrapperBindingSource.Position = (int)componentId.Current;
     }
     WrapperID.DataBindings.Add("Text", WrapperBindingSource, "ID");
     WrapperComboBox.DataSource = dataTable;
     WrapperComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     WrapperComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
     WrapperComboBox.DisplayMember = dataTable.Columns[1].ColumnName;
     WrapperComboBox.ValueMember = dataTable.Columns[0].ColumnName;
     //WrapperComboBox.DataSource = WrapperBindingSource;
     WrapperComboBox.SelectedValueChanged += WrapperComboBox_SelectedValueChanged;
     WrapperComponentSelection.Click+=WrapperComponentSelection_Click;
     WrapperComboBox.Validated += WrapperComboBox_Validated;
     WrapperLabel.Text = tableName.Name;
     WrapperID.TextChanged += WrapperID_TextChanged;
     //WrapperComboBox.DataBin
     type = tableName;
 }
开发者ID:profimedica,项目名称:SYKYO,代码行数:34,代码来源:DataWraper.cs


示例7: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            if (IDtextBox.Text.Length == 0)
            {
                ErrorProvider error = new ErrorProvider();
                Utilities.Utilitarios.Validacion(DescripciontextBox, error, "No puede haver campos en blanco");
                registro.Descripcion = DescripciontextBox.Text;

                if (registro.Insertar())
                {
                    MessageBox.Show("Se guardaron los datos!");
                }
                else
                {
                    MessageBox.Show("No se han guardado los datos!");
                }

            }
            else if(IDtextBox.Text.Length > 0)
            {
                int.TryParse(IDtextBox.Text, out certificacionId);
                registro.CertificacionID = certificacionId;

                registro.Descripcion = DescripciontextBox.Text;

                if (registro.Editar())
                {
                    MessageBox.Show("Se han actualizado los datos!");
                }
                else
                {
                    MessageBox.Show("No se han guardado los datos!");
                }
            }
        }
开发者ID:AlbertPadi,项目名称:CocoaExportProyect,代码行数:35,代码来源:Certificaciones.cs


示例8: ValidateCheckList

 public static bool ValidateCheckList(CheckedListBox boxes, ErrorProvider errorProvider)
 {
     if(boxes.CheckedItems.Count > 0)
         return true;
     errorProvider.SetError(boxes, "Este campo es obligatorio");
     return false;
 }
开发者ID:faloi,项目名称:cuponete,代码行数:7,代码来源:ValidatorHelper.cs


示例9: ValidateComboBox

 public static bool ValidateComboBox(ComboBox boxes, ErrorProvider errorProvider)
 {
     if (!boxes.SelectedIndex.Equals(-1))
         return true;
     errorProvider.SetError(boxes, "Este campo es obligatorio");
     return false;
 }
开发者ID:faloi,项目名称:cuponete,代码行数:7,代码来源:ValidatorHelper.cs


示例10: ProjectBehavioralTestControl

 public ProjectBehavioralTestControl(Project project, int behavioralTestIndex, ErrorProvider errorProvider)
 {
     _BehavioralTest = project.BehavioralTests[behavioralTestIndex];
     InitializeComponent();
     _ErrorProvider = errorProvider;
     lblBehavioralTest.Text = project.BehavioralTests[behavioralTestIndex].Name;
 }
开发者ID:kinoscope,项目名称:kinoscope,代码行数:7,代码来源:ProjectBehavioralTestControl.cs


示例11: PilotDataLoaderForm

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="parent">The MDI parent.</param>
        public PilotDataLoaderForm(Form parent)
        {
            _parent = parent;

            InitializeComponent();

            _proxySettings = ProxySettingsDTO.GetProxySettings();

            LoadTourDefs();

            _StartTourErrorProvider = new System.Windows.Forms.ErrorProvider();
            _StartTourErrorProvider.SetIconAlignment(this.txtbxStartTour, ErrorIconAlignment.MiddleRight);
            _StartTourErrorProvider.SetIconPadding(this.txtbxStartTour, 2);
            _StartTourErrorProvider.BlinkRate = 700;
            _StartTourErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            _EndTourErrorProvider = new System.Windows.Forms.ErrorProvider();
            _EndTourErrorProvider.SetIconAlignment(this.txtbxEndTour, ErrorIconAlignment.MiddleRight);
            _EndTourErrorProvider.SetIconPadding(this.txtbxEndTour, 2);
            _EndTourErrorProvider.BlinkRate = 700;
            _EndTourErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            _PilotNameErrorProvider = new System.Windows.Forms.ErrorProvider();
            _PilotNameErrorProvider.SetIconAlignment(this.txtbxPilotToLoad, ErrorIconAlignment.MiddleRight);
            _PilotNameErrorProvider.SetIconPadding(this.txtbxPilotToLoad, 2);
            _PilotNameErrorProvider.BlinkRate = 700;
            _PilotNameErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            _TourTypeSelectorErrorProvider = new System.Windows.Forms.ErrorProvider();
            _TourTypeSelectorErrorProvider.SetIconAlignment(this.txtbxPilotToLoad, ErrorIconAlignment.MiddleRight);
            _TourTypeSelectorErrorProvider.SetIconPadding(this.txtbxPilotToLoad, 2);
            _TourTypeSelectorErrorProvider.BlinkRate = 700;
            _TourTypeSelectorErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;
        }
开发者ID:petegee,项目名称:AHPilotStats,代码行数:38,代码来源:PilotDataLoaderForm.cs


示例12: OnInstanceConstructed

        public void OnInstanceConstructed()
        {
            _currentForm = (Form) Instance;
            _controlledBindings = new List<ControlledBinding>();

            var errorProvider = Instance.GetType()
                                         .GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)
                                         .FirstOrDefault(x => x.FieldType == typeof(ErrorProvider));

            if (errorProvider != null)
            {
                _currentErrorProvider = (ErrorProvider)errorProvider.GetValue(Instance);
            }
            else
            {
                _currentErrorProvider = new ErrorProvider(_currentForm);
            }

            var bindingSources = Instance.GetType()
                                         .GetFields(BindingFlags.NonPublic | BindingFlags.Public |BindingFlags.Instance)
                                         .Where(x => x.FieldType == typeof(BindingSource));

            foreach (var bindingSource in bindingSources)
            {
               ((BindingSource)bindingSource.GetValue(Instance)).CurrentChanged += OnCurrentChanged;
            }
        }
开发者ID:fpommerening,项目名称:PostSharpSamples,代码行数:27,代码来源:IncludeErrorProviderAspect.cs


示例13: formValido

        public bool formValido(ErrorProvider errorProvider)
        {
            bool validado = true;

            foreach (var objeto in objetosValidar)
            {
                switch (objeto.Tipo)
                {
                    case TipoCampos.Texto:
                        if (((TextBox)objeto.Objeto).Text == string.Empty)
                        {
                            errorProvider.SetError((Control)objeto.Objeto, objeto.Mensaje == string.Empty ? "Debe ingresar el valor solicidado" : objeto.Mensaje);
                            validado = false;
                        }

                        break;
                    case TipoCampos.Numero:
                        break;
                    default:
                        break;
                }
            }

            return validado;
        }
开发者ID:ehitel,项目名称:PERFECT-DS,代码行数:25,代码来源:ValidacionCampos.cs


示例14: FormValidator

        /// <summary>
        /// Initializes a new instance of the <see cref="FormValidator"/> class. 
        /// And bind this instance to corresponding form;
        /// </summary>
        public FormValidator(Form form)
        {
            // check if validator is already exists for this form;
            if (validators.ContainsKey(form))
                throw new InvalidOperationException("This form already has a validator, you can't create another one.");

            // construct providers
            errorProvider = new ErrorProvider(form)
                {
                    BlinkStyle = ErrorBlinkStyle.NeverBlink,
                    Icon = Teleavtomatika_Form_Validation.Properties.Resources.RedCircle
                };

            exclamationProvider = new ErrorProvider(form)
            {
                BlinkStyle = ErrorBlinkStyle.NeverBlink,
                Icon = Teleavtomatika_Form_Validation.Properties.Resources.YellowCircle
            };

            // bind to form and add to validators dictionary
            this.form = form;
            if (!validators.TryAdd(form, this))
                throw new InvalidOperationException("Can't create FormValidator.");

            // create validation timer and start it
            timer = new System.Windows.Forms.Timer() { Interval = 100, Enabled = true };
            timer.Tick += new EventHandler(timer_Tick);

            // bind object disposing to form disposed event
            form.Disposed += (s, e) => Dispose();

            // remember created thread
            thread = Thread.CurrentThread;
        }
开发者ID:CyrilvonLutzow,项目名称:Teleavtomatika_Form_Validation,代码行数:38,代码来源:FormValidator.cs


示例15: Usluga

        public Usluga(ErrorProvider ponudaErrorProvider, TextBox artikalTextBox, TextBox cena, TextBox cenaUgradnje, TextBox normaSati, Int32 usluga_ID)
            : this()
        {
            this.ControlBox = true;
            this.MinimizeBox = false;
            this.StartPosition = FormStartPosition.CenterParent;

            UslugaTextBox = artikalTextBox;
            CenaTextBox = cena;
            CenaUgradnjeTextBox = cenaUgradnje;
            NormaSatiTextBox = normaSati;
            PonudaErrorProvider = ponudaErrorProvider;


            this.uslugaDataGridView.CellMouseDoubleClick += new DataGridViewCellMouseEventHandler(uslugaDataGridView_CellMouseDoubleClick);

            try
            {
                DBUsluga.NadjiUslugu(uslugaDataSet.vwUsluga, usluga_ID);
            }
            catch (Exception)
            {
                //nista
            }
        }
开发者ID:vodolijabg,项目名称:LS,代码行数:25,代码来源:Usluga.cs


示例16: Delete_Patients

 public Delete_Patients()
 {
     InitializeComponent();
     ValidateData = new Data_Validator();
     Error = new ErrorProvider();
     Delete = new DCEntities();
 }
开发者ID:yunsiong,项目名称:DPPD-Dental-Clinic-Management-System,代码行数:7,代码来源:Delete+Patients.cs


示例17: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            ErrorProvider erro = new ErrorProvider();
            if(TitulotextBox.Text.Length == 0 || DescripcionrichTextBox.Text.Length == 0)
            {
                erro.SetError(TitulotextBox,"No puede dejar este campo vacio");
                erro.SetError(DescripcionrichTextBox,"Debe llenar este campo");
            }
            else
            {
                Pelicula p = new Pelicula();
                p.Titulo = TitulotextBox.Text;
                p.Descripcion = DescripcionrichTextBox.Text;

                int resultado = PeliculaConexion.Agregar(p);

                if(resultado > 0)
                {
                    MessageBox.Show("Se guardo la Pelicula", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    TitulotextBox.Text = "";
                    DescripcionrichTextBox.Text = "";
                }
                else
                {
                    MessageBox.Show("No se pudo guardar la pelicula", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

            }
        }
开发者ID:Melvin0496,项目名称:Tarea-11---Aplicada-I---Melvin-Gabriel-,代码行数:29,代码来源:NuevaPelicula.cs


示例18: btnSave_Click

        private void btnSave_Click(object sender, EventArgs e)
        {
            ErrorProvider errorProvider1 = new ErrorProvider();
            if (string.IsNullOrWhiteSpace(this.txtSubject.Text))
            {
                errorProvider1.SetError(this.txtSubject, "必填。");
                return;
            }
            else
                errorProvider1.SetError(this.txtSubject, "");

            try
            {
                this.btnSave.Enabled = false;
                conf.Content = webBrowser1.Document.Body.InnerHtml.Replace("<div id=\"editable\">", string.Empty);
                conf_subject.Content = this.txtSubject.Text.Trim();
                List<ActiveRecord> recs = new List<ActiveRecord>();
                recs.Add(conf);
                recs.Add(conf_subject);
                (new AccessHelper()).UpdateValues(recs);
                MessageBox.Show("儲存成功。");
                //this.Close();
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex.Message);
            }
            finally
            {
                this.btnSave.Enabled = true;
            }
        }
开发者ID:jungfengpaulwang,项目名称:EMBATeachingEvaluation,代码行数:32,代码来源:CS_Template.cs


示例19: TeacherExtDetail

 public TeacherExtDetail()
     : base()
 {
     InitializeComponent();
     ErrorProvider1 = new ErrorProvider();
     this.Group = "教師基本資料";
 }
开发者ID:jungfengpaulwang,项目名称:EMBACore,代码行数:7,代码来源:TeacherExtDetail.cs


示例20: RegisterForm

 public RegisterForm(MainForm mainForm)
 {
     InitializeComponent();
     this.mainForm = mainForm;
     mainForm.getClient().getAdvisorList();
     ep = new ErrorProvider();
 }
开发者ID:Nitzahon,项目名称:10212-TicTacToe,代码行数:7,代码来源:RegisterForm.cs



注:本文中的System.Windows.Forms.ErrorProvider类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.FileDialog类代码示例发布时间:2022-05-26
下一篇:
C# Forms.DrawTreeNodeEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap