本文整理汇总了C#中System.Windows.Forms.ErrorProvider类的典型用法代码示例。如果您正苦于以下问题:C# ErrorProvider类的具体用法?C# ErrorProvider怎么用?C# ErrorProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ErrorProvider类属于System.Windows.Forms命名空间,在下文中一共展示了ErrorProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PolicyDesignerErrorProvider
public PolicyDesignerErrorProvider(
Interfaces.IErrorProviderCollection errorProviderCollection,
ErrorProvider errorProvider)
{
m_parentCollection = errorProviderCollection;
m_errorProvider = errorProvider;
}
示例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);
}
}
示例4: UserInfoManager
public UserInfoManager()
{
InitializeComponent();
_errorProvider = new ErrorProvider();
//lblUserid.Text = "【 " + CurrentUser.Instance.UserName + " 】";
}
示例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)));
}
示例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;
}
示例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!");
}
}
}
示例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;
}
示例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;
}
示例10: ProjectBehavioralTestControl
public ProjectBehavioralTestControl(Project project, int behavioralTestIndex, ErrorProvider errorProvider)
{
_BehavioralTest = project.BehavioralTests[behavioralTestIndex];
InitializeComponent();
_ErrorProvider = errorProvider;
lblBehavioralTest.Text = project.BehavioralTests[behavioralTestIndex].Name;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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
}
}