本文整理汇总了C#中System.Windows.Forms.ErrorProvider.SetIconAlignment方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorProvider.SetIconAlignment方法的具体用法?C# ErrorProvider.SetIconAlignment怎么用?C# ErrorProvider.SetIconAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ErrorProvider
的用法示例。
在下文中一共展示了ErrorProvider.SetIconAlignment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: frmEditUser
public frmEditUser(User user)
{
InitializeComponent();
this.user = user;
err = new ErrorProvider();
err.BlinkStyle = ErrorBlinkStyle.NeverBlink;
err.SetIconAlignment(cbRoles, ErrorIconAlignment.MiddleRight);
err.SetIconPadding(cbRoles, 2);
}
示例3: InitializeErrorProvider
public static ErrorProvider InitializeErrorProvider(Control tb)
{
ErrorProvider ep = new ErrorProvider();
ep.SetIconAlignment(tb, ErrorIconAlignment.MiddleRight);
ep.SetIconPadding(tb, 2);
ep.BlinkRate = 750;
ep.BlinkStyle = ErrorBlinkStyle.AlwaysBlink;
ep.Icon = new System.Drawing.Icon("icons/ladybug.ico");
return ep;
}
示例4: PeopleForm
public PeopleForm(string title=null, IPeopleFormDelegate peopleFormDelegate = null, bool openForUpdate = false,string surname="", string firstname="", string password="", string comment="")
{
if (null != title) this.Text = title;
_openForUpdate = openForUpdate;
_peopleFormDelegate = peopleFormDelegate;
this.SetBounds(10, 10, 200, 220);
Label lbl1, lbl2,lbl3, lbl4;
TextBox txt1, txt2,txt3,txt4;
Button btn = new Button();
this.Controls.Add(lbl1 = new Label());
lbl1.SetBounds(5, 5, 185, 18);
lbl1.Text = "firstname";
this.Controls.Add(txt1 = new TextBox());
txt1.SetBounds(5, 25, 185, 18);
txt1.Text = firstname;
this.Controls.Add(lbl2 = new Label());
lbl2.Text = "surname";
lbl2.SetBounds(5, 45, 185, 18);
this.Controls.Add(txt2 = new TextBox());
txt2.SetBounds(5, 65, 165, 18);
txt2.Text = surname;
this.Controls.Add(lbl3 = new Label());
lbl3.SetBounds(5, 85, 185, 18);
lbl3.Text = "password";
this.Controls.Add(txt3 = new TextBox());
txt3.SetBounds(5, 105, 185, 18);
txt3.Text = password;
this.Controls.Add(lbl4 = new Label());
lbl4.SetBounds(5, 125, 185, 18);
lbl4.Text = "comment";
this.Controls.Add(txt4 = new TextBox());
txt4.SetBounds(5, 145, 185, 18);
txt4.Text = comment;
this.Controls.Add(btn);
btn.SetBounds(5, 165, 185, 18);
ErrorProvider ep = new ErrorProvider();
ep.SetIconAlignment(txt2, ErrorIconAlignment.MiddleRight);
ep.SetIconPadding(txt2, 2);
btn.Text = openForUpdate ? "Save people" : "Add people";
btn.Click += (object sender1, EventArgs e1) =>
{
if (string.IsNullOrWhiteSpace(txt2.Text))
{
ep.SetError(txt2, "Surname must contain chars");
return;
}
ep.SetError(txt2, string.Empty);
if (null != this._peopleFormDelegate) _peopleFormDelegate.saved(txt2.Text, txt1.Text, txt3.Text, txt4.Text);
if(openForUpdate) this.Close();
};
}
示例5: BaseControl
/// <summary>
/// Creates a new instance of BaseControl class.
/// </summary>
protected BaseControl()
{
error = new ErrorProvider();
error.SetIconAlignment(this, ErrorIconAlignment.MiddleLeft);
error.BlinkStyle = ErrorBlinkStyle.NeverBlink;
error.SetIconPadding(this, 5);
font = new Font("TAHOMA", 8, FontStyle.Regular);
allowWrap = true;
textHorizontalAlignment = TextAlignment.Default;
textVerticalAlignment = TextAlignment.Default;
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.ResizeRedraw, true);
}
示例6: LoadControls
private void LoadControls()
{
typesAdapter = new TYPESTableAdapter();
typesBinding = new BindingSource(pollsDataSet, "TYPES");
typesAdapter.Fill(pollsDataSet.TYPES);
checkedListBoxType.DataSource = typesBinding;
checkedListBoxType.DisplayMember = "NAME";
checkedListBoxType.ValueMember = "TYPE";
maskedTextBoxNumber.Text="";
//Инициализируем ErrorProvider отвечающий за контроль номера анкеты
_numberErr = new ErrorProvider();
_numberErr.SetIconAlignment(maskedTextBoxNumber, ErrorIconAlignment.MiddleRight);
_numberErr.SetIconPadding(maskedTextBoxNumber, 2);
_numberErr.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.BlinkIfDifferentError;
//filialTableAdapter = new FILIALTableAdapter();
//filialBindingSource = new BindingSource(pollsDataSet,"FILIAL");
if (_user.dictionary_arms[_num_module].CodObl != 0)
{
// filialBindingSource.Filter = "COD_FIL=" + _user.PrivilegesCodObl;
fILIALBindingSource.Filter = "COD_FIL=" + _user.dictionary_arms[_num_module].CodObl;
}
fILIALTableAdapter.Fill(pollsDataSet.FILIAL, DateTime.Now);
sTRUCT_UNITTableAdapter.Fill(pollsDataSet.STRUCT_UNIT, DateTime.Now);
rKCViewTableAdapter.ClearBeforeFill = false;
pollsDataSet.RKCView.AddRKCViewRow(0, "<Отделение>");
//structTableAdapter = new STRUCT_UNITTableAdapter();
//structBindingSource = new BindingSource(pollsDataSet, "STRUCT_UNIT");
pollsDataSet.SEX.AddSEXRow("М", "Мужской");
pollsDataSet.SEX.AddSEXRow("Ж", "Женский");
pollsDataSet.TransTypes.AddTransTypesRow("М", "Мигом");
pollsDataSet.TransTypes.AddTransTypesRow("В", "Western Union");
pollsDataSet.TransTypes.AddTransTypesRow("Х", "Хуткiя грошы");
//filialTableAdapter.Fill(pollsDataSet.FILIAL, DateTime.Now);
//comboBoxRegion.DataSource = filialBindingSource;
//comboBoxRegion.DisplayMember = pollsDataSet.FILIAL.NAMEColumn.ColumnName;
//comboBoxRegion.ValueMember = pollsDataSet.FILIAL.COD_FILColumn.ColumnName;
//structTableAdapter.Fill(pollsDataSet.STRUCT_UNIT, DateTime.Now);
//comboBoxStructUnite.DataSource = structBindingSource;
//comboBoxStructUnite.DisplayMember = pollsDataSet.STRUCT_UNIT.NAMEColumn.ColumnName;
//comboBoxStructUnite.ValueMember = pollsDataSet.STRUCT_UNIT.BRANCHColumn.ColumnName;
//rkcTableAdapter = new RKCViewTableAdapter();
//rkcBindingSource = new BindingSource(pollsDataSet, "RKCView");
//rkcTableAdapter.ClearBeforeFill = false;
//comboBoxRKC.DataSource = rkcBindingSource;
//comboBoxRKC.DisplayMember = pollsDataSet.RKC.NAMEColumn.ColumnName;
//comboBoxRKC.ValueMember = pollsDataSet.RKC.CODE_RKCColumn.ColumnName;
}
示例7: InitializeForm
private void InitializeForm()
{
//Инициализируем ErrorProvider отвечающий за контроль номера анкеты
_numberErr = new ErrorProvider();
_numberErr.SetIconAlignment(this.numberTextBox, ErrorIconAlignment.MiddleRight);
_numberErr.SetIconPadding(this.numberTextBox, 2);
_numberErr.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.BlinkIfDifferentError;
//pollsDataSet = Owner.pollsDataSet;
//Устанавливаем начальные значения возраста и номера анкеты.
ageUpDown.Value = ageUpDown.Minimum;
numberTextBox.Text = "";
acceptChangesButton.Enabled = false;
//Заполняем таблице Sex
pollsDataSet.Sex.Clear();
pollsDataSet.Sex.AddSexRow('m', "Мужской");
pollsDataSet.Sex.AddSexRow('f', "Женский");
if (_user.PrivilegesCodObl != 0)
//Заполняем поле область в зависимости от предоставленых прав доступа
//Если это ЦА то CodObl=0 - доступ к анкетам всех подразделений
//Иначе - доступ к анкетам в пределах одной области
{
fILIALBindingSource.DataSource =
fILIALTableAdapter.GetData(System.DateTime.Now, System.DateTime.Now).Where(
c => c.COD_FIL == (decimal)_user.PrivilegesCodObl).AsDataView();
}
else
{
fILIALBindingSource.DataSource =
fILIALTableAdapter.GetData(System.DateTime.Now, System.DateTime.Now);
}
//Заполняем таблицу отделений
sTRUCTUNITBindingSource.DataSource = sTRUCT_UNITTableAdapter.GetData(System.DateTime.Now,
System.DateTime.Now,
(decimal)filialСomboBox.SelectedValue);
//{ Запоняем таблицу РКЦ с добавлением кода РКЦ 0 для выбора самого отделения
tmpRKCTable = new PollsDataSet.RKCDataTable();
tmpRKCTable.AddRKCRow("<Отделение>", 0);
rKCTableAdapter.ClearBeforeFill = false;
rKCTableAdapter.Fill(tmpRKCTable, System.DateTime.Now, System.DateTime.Now,
(decimal)otdComboBox.SelectedValue);
rKCBindingSource.DataSource = tmpRKCTable;
//}
pollsTabControl.TabPages[0].Name = "DEPOS";
pollsTabControl.TabPages[0].Text = "Вклады";
pollsTabControl.TabPages[1].Name = "BANK";
pollsTabControl.TabPages[1].Text = "Банк";
pollsTabControl.TabPages[0].Controls.Clear();
pollsTabControl.TabPages[1].Controls.Clear();
//_collectionCriterion = new Collection<Criterion>();
fillTabDepos(0);
fillTabBank(1);
}
示例8: GetandSetIconAlignmentTest
public void GetandSetIconAlignmentTest ()
{
TextBox myTextBox = new TextBox ();
ErrorProvider myErrorProvider = new ErrorProvider ();
myErrorProvider.SetIconAlignment (myTextBox, ErrorIconAlignment.MiddleRight);
Assert.AreEqual (ErrorIconAlignment.MiddleRight, myErrorProvider.GetIconAlignment (myTextBox), "#getset2");
}
示例9: Bug420305
public void Bug420305 ()
{
// Should not throw an NRE
Form f = new Form ();
TextBox tb = new TextBox ();
ErrorProvider ep = new ErrorProvider ();
ep.ContainerControl = f;
ep.SetIconAlignment (tb, ErrorIconAlignment.MiddleRight);
ep.SetIconPadding (tb, 2);
f.Controls.Add (tb);
ep.SetError (tb, "arggggh");
}
示例10: SetErrorProvider
public static void SetErrorProvider(ErrorProvider ep, Control tb)
{
ep.SetIconAlignment(tb, ErrorIconAlignment.MiddleRight);
ep.SetIconPadding(tb, 2);
}
示例11: SetErrorProviderIconsAlignment
internal void SetErrorProviderIconsAlignment(ErrorProvider errorProvider)
{
errorProvider.SetIconAlignment(this.cmbServers, ErrorIconAlignment.MiddleLeft);
errorProvider.SetIconAlignment(this.httpUrlTextBox, ErrorIconAlignment.MiddleLeft);
errorProvider.SetIconAlignment(this.txtName, ErrorIconAlignment.MiddleLeft);
}
示例12: ParamError
public ParamError(MainForm parentSpec)
{
parent = parentSpec;
// initialize all error objects
// un-tabbed errors
appFiles = new ErrorProvider();
appFiles.SetIconAlignment(parent.textBoxAppFiles, ErrorIconAlignment.MiddleRight);
appFiles.SetIconPadding(parent.textBoxAppFiles, 2);
appFiles.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
aisFile = new ErrorProvider();
aisFile.SetIconAlignment(parent.textBoxAISfile, ErrorIconAlignment.MiddleRight);
aisFile.SetIconPadding(parent.textBoxAISfile, 2);
aisFile.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
// general tab errors
generalClock = new ErrorProvider();
generalClock.SetIconAlignment(parent.textBoxClockSpeed, ErrorIconAlignment.MiddleRight);
generalClock.SetIconPadding(parent.textBoxClockSpeed, 2);
generalClock.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
generalEntryPoint = new ErrorProvider();
generalEntryPoint.SetIconAlignment(parent.textBoxSpecifyEntrypoint, ErrorIconAlignment.MiddleRight);
generalEntryPoint.SetIconPadding(parent.textBoxSpecifyEntrypoint, 2);
generalEntryPoint.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
// peripheral tab errors
periphIdealClock = new ErrorProvider();
periphIdealClock.SetIconAlignment(parent.textBoxPeriphClockIdeal, ErrorIconAlignment.MiddleRight);
periphIdealClock.SetIconPadding(parent.textBoxPeriphClockIdeal, 2);
periphIdealClock.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
periphModuleClock = new ErrorProvider();
periphModuleClock.SetIconAlignment(parent.textBoxPeriphModuleClock, ErrorIconAlignment.MiddleRight);
periphModuleClock.SetIconPadding(parent.textBoxPeriphModuleClock, 2);
periphModuleClock.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
// pll0 tab errors
pll0preDiv = new ErrorProvider();
pll0preDiv.SetIconAlignment(parent.textBoxPLL0preDiv, ErrorIconAlignment.MiddleRight);
pll0preDiv.SetIconPadding(parent.textBoxPLL0preDiv, 2);
pll0preDiv.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
pll0postDiv = new ErrorProvider();
pll0postDiv.SetIconAlignment(parent.textBoxPLL0postDiv, ErrorIconAlignment.MiddleRight);
pll0postDiv.SetIconPadding(parent.textBoxPLL0postDiv, 2);
pll0postDiv.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
pll0mult = new ErrorProvider();
pll0mult.SetIconAlignment(parent.textBoxPLL0mult, ErrorIconAlignment.MiddleRight);
pll0mult.SetIconPadding(parent.textBoxPLL0mult, 2);
pll0mult.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
pll0div1 = new ErrorProvider();
pll0div1.SetIconAlignment(parent.textBoxPLL0div1, ErrorIconAlignment.MiddleRight);
pll0div1.SetIconPadding(parent.textBoxPLL0div1, 2);
pll0div1.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
pll0div3 = new ErrorProvider();
pll0div3.SetIconAlignment(parent.textBoxPLL0div3, ErrorIconAlignment.MiddleRight);
pll0div3.SetIconPadding(parent.textBoxPLL0div3, 2);
pll0div3.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
pll0div7 = new ErrorProvider();
pll0div7.SetIconAlignment(parent.textBoxPLL0div7, ErrorIconAlignment.MiddleRight);
pll0div7.SetIconPadding(parent.textBoxPLL0div7, 2);
pll0div7.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
pll0cpu = new ErrorProvider();
pll0cpu.SetIconAlignment(parent.textBoxPLL0cpu, ErrorIconAlignment.MiddleRight);
pll0cpu.SetIconPadding(parent.textBoxPLL0cpu, 2);
pll0cpu.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
pll0sdram = new ErrorProvider();
pll0sdram.SetIconAlignment(parent.textBoxPLL0sdram, ErrorIconAlignment.MiddleRight);
pll0sdram.SetIconPadding(parent.textBoxPLL0sdram, 2);
pll0sdram.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
pll0emac = new ErrorProvider();
pll0emac.SetIconAlignment(parent.textBoxPLL0emac, ErrorIconAlignment.MiddleRight);
pll0emac.SetIconPadding(parent.textBoxPLL0emac, 2);
pll0emac.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
// sdram tab errors
sdramClock = new ErrorProvider();
sdramClock.SetIconAlignment(parent.textBoxSDRAMclock, ErrorIconAlignment.MiddleRight);
sdramClock.SetIconPadding(parent.textBoxSDRAMclock, 2);
sdramClock.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
sdramSdbcr = new ErrorProvider();
sdramSdbcr.SetIconAlignment(parent.textBoxSDRAMsdbcr, ErrorIconAlignment.MiddleRight);
sdramSdbcr.SetIconPadding(parent.textBoxSDRAMsdbcr, 2);
sdramSdbcr.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
sdramSdtmr = new ErrorProvider();
sdramSdtmr.SetIconAlignment(parent.textBoxSDRAMsdtmr, ErrorIconAlignment.MiddleRight);
sdramSdtmr.SetIconPadding(parent.textBoxSDRAMsdtmr, 2);
sdramSdtmr.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
//.........这里部分代码省略.........
示例13: SetUserNameError
internal void SetUserNameError(ErrorProvider errorProvider, string errroMessage)
{
errorProvider.SetIconAlignment(this.cmbUsers, ErrorIconAlignment.MiddleRight);
errorProvider.SetError(this.cmbUsers, errroMessage);
}
示例14: SetErrorProvider
private void SetErrorProvider(ErrorProvider activeErrorProvider, Control activeControl, string message, ErrorIconAlignment iconAlignment)
{
activeErrorProvider.SetIconAlignment(activeControl, iconAlignment);
activeErrorProvider.SetError(activeControl, message);
var ttPoint = new Point(Convert.ToInt32(activeControl.Width / 2 - 20), -80);
IpToolTip.IsBalloon = true;
IpToolTip.UseFading = true;
IpToolTip.ToolTipTitle = "Validation Error";
IpToolTip.ToolTipIcon = ToolTipIcon.Error;
IpToolTip.Show(message, activeControl, ttPoint, 5000);
}
示例15: SetErrorProvider
/// <summary>
/// 設定某個元件的錯誤訊息
/// </summary>
/// <param name="control">控制項物件</param>
/// <param name="p">錯誤訊息</param>
/// <param name="isError">是否為錯誤或警告</param>
private void SetErrorProvider(Control control, string p, bool isError)
{
if (_ErrorControls.Contains(control))
{
_ErrorControls.Remove(control);
}
if (!_errorProviderDictionary.ContainsKey(control))
{
ErrorProvider ep = new ErrorProvider();
ep.BlinkStyle = ErrorBlinkStyle.NeverBlink;
ep.SetIconAlignment(control, ErrorIconAlignment.MiddleRight);
if (isError)
{
ep.Icon = Properties.Resources.error;
}
else
{
ep.Icon = Properties.Resources.warning;
}
ep.SetError(control, p);
_errorProviderDictionary.Add(control, ep);
}
if (isError)
{
_ErrorControls.Add(control);
}
}