本文整理汇总了C#中System.Windows.Forms.ErrorProvider.SetIconPadding方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorProvider.SetIconPadding方法的具体用法?C# ErrorProvider.SetIconPadding怎么用?C# ErrorProvider.SetIconPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ErrorProvider
的用法示例。
在下文中一共展示了ErrorProvider.SetIconPadding方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
};
}
示例4: 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);
}
示例5: 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;
}
示例6: 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);
}
示例7: 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");
}
示例8: GetandSetIconPaddingTest
public void GetandSetIconPaddingTest ()
{
Form myForm = new Form ();
myForm.ShowInTaskbar = false;
ErrorProvider myErrorProvider = new ErrorProvider ();
myErrorProvider.SetIconPadding (myForm, 2);
Assert.AreEqual (2, myErrorProvider.GetIconPadding (myForm), "#getset3");
myForm.Dispose ();
}
示例9: 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;
}
示例10: SetErrorProvider
public static void SetErrorProvider(ErrorProvider ep, Control tb)
{
ep.SetIconAlignment(tb, ErrorIconAlignment.MiddleRight);
ep.SetIconPadding(tb, 2);
}
示例11: RegisterControl
public void RegisterControl(Control control, Func<string> validationFunc)
{
if (control != null && validationFunc != null) {
ErrorProvider errorProvider = new ErrorProvider();
EventHandler validatedHandler = (sender, e) => {
string msg = validationFunc();
if (msg != null) {
errorProvider.SetIconPadding(control, DetermineErrorIconPadding(control));
errorProvider.SetError(control, msg);
}
else
errorProvider.SetError(control, String.Empty);
Validate();
};
EventHandler textChangedHandler = (sender, e) => {
if (validationFunc() == null)
errorProvider.SetError(control, String.Empty);
Validate();
};
ControlRecord record = new ControlRecord() {
Control = control,
ErrorProvider = errorProvider,
ValidatedHandler = validatedHandler,
TextChangedHandler = textChangedHandler,
};
record.Link();
_controls.Add(record);
_validateFuncs.Add(validationFunc);
}
}
示例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: InitializeComponent
//.........这里部分代码省略.........
nudPreambleSize.BeginInit();
pnlAesEncryption.SuspendLayout();
pnlDcFree.SuspendLayout();
pnlAddressInPayload.SuspendLayout();
pnlFifoFillCondition.SuspendLayout();
pnlSync.SuspendLayout();
pnlCrcAutoClear.SuspendLayout();
pnlCrcCalculation.SuspendLayout();
pnlTxStart.SuspendLayout();
pnlAddressFiltering.SuspendLayout();
pnlPacketFormat.SuspendLayout();
tableLayoutPanel1.SuspendLayout();
pnlPayloadLength.SuspendLayout();
nudPayloadLength.BeginInit();
nudSyncSize.BeginInit();
nudSyncTol.BeginInit();
pnlNodeAddress.SuspendLayout();
nudNodeAddress.BeginInit();
pnlBroadcastAddress.SuspendLayout();
nudBroadcastAddress.BeginInit();
tableLayoutPanel2.SuspendLayout();
nudFifoThreshold.BeginInit();
gBoxDeviceStatus.SuspendLayout();
gBoxControl.SuspendLayout();
gBoxPacket.SuspendLayout();
gBoxMessage.SuspendLayout();
tblPayloadMessage.SuspendLayout();
tblPacket.SuspendLayout();
pnlPacketCrc.SuspendLayout();
pnlPacketAddr.SuspendLayout();
base.SuspendLayout();
errorProvider.ContainerControl = this;
tBoxSyncValue.Anchor = AnchorStyles.Left;
errorProvider.SetIconPadding(tBoxSyncValue, 6);
tBoxSyncValue.InsertKeyMode = InsertKeyMode.Overwrite;
tBoxSyncValue.Location = new Point(0xa3, 0x7a);
tBoxSyncValue.Margin = new Padding(3, 2, 3, 2);
tBoxSyncValue.Mask = "&&-&&-&&-&&-&&-&&-&&-&&";
tBoxSyncValue.Name = "tBoxSyncValue";
tBoxSyncValue.Size = new Size(0x8f, 20);
tBoxSyncValue.TabIndex = 14;
tBoxSyncValue.Text = "AAAAAAAAAAAAAAAA";
tBoxSyncValue.MaskInputRejected += new MaskInputRejectedEventHandler(tBoxSyncValue_MaskInputRejected);
tBoxSyncValue.TypeValidationCompleted += new TypeValidationEventHandler(tBoxSyncValue_TypeValidationCompleted);
tBoxSyncValue.TextChanged += new EventHandler(tBoxSyncValue_TextChanged);
tBoxSyncValue.KeyDown += new KeyEventHandler(tBoxSyncValue_KeyDown);
tBoxSyncValue.MouseEnter += new EventHandler(control_MouseEnter);
tBoxSyncValue.MouseLeave += new EventHandler(control_MouseLeave);
tBoxSyncValue.Validated += new EventHandler(tBox_Validated);
nudPreambleSize.Anchor = AnchorStyles.Left;
errorProvider.SetIconPadding(nudPreambleSize, 6);
nudPreambleSize.Location = new Point(0xa3, 2);
nudPreambleSize.Margin = new Padding(3, 2, 3, 2);
int[] bits = new int[4];
bits[0] = 0xffff;
nudPreambleSize.Maximum = new decimal(bits);
nudPreambleSize.Name = "nudPreambleSize";
nudPreambleSize.Size = new Size(0x3b, 20);
nudPreambleSize.TabIndex = 1;
int[] numArray2 = new int[4];
numArray2[0] = 3;
nudPreambleSize.Value = new decimal(numArray2);
nudPreambleSize.MouseEnter += new EventHandler(control_MouseEnter);
nudPreambleSize.MouseLeave += new EventHandler(control_MouseLeave);
nudPreambleSize.ValueChanged += new EventHandler(nudPreambleSize_ValueChanged);
label12.Anchor = AnchorStyles.None;
示例14: MainWindow
public MainWindow() {
this.ClientSize = new Size(300, 300);
this.StartPosition = FormStartPosition.CenterScreen;
this.SuspendLayout();
label1 = new Label();
label1.Font = new Font("Arial", 24);
label1.Location= new Point(15, 15);
label1.Size = new Size(70, 70);
label1.Text="Label1";
label1.ForeColor = Color.Green;
label1.BackColor = Color.LightGray;
label1.Anchor=AnchorStyles.Left | AnchorStyles.Top;
this.Controls.Add(label1);
label2 = new Label();
label2.Font = new Font("Times New Roman", 16);
label2.Location= new Point(115, 15);
label2.Size = new Size(70, 70);
label2.Text="Label2";
label2.ForeColor = Color.Red;
label2.BackColor = Color.White;
this.Controls.Add(label2);
label3 = new Label();
label3.Font = new Font("Sans Serif", 12);
label3.Location= new Point(15, 215);
label3.Size = new Size(70, 70);
label3.Text="Label3";
label3.ForeColor = Color.Red;
label3.BackColor = Color.White;
this.Controls.Add(label3);
label4 = new Label();
label4.Font = new Font("Arial", 24);
label4.Location= new Point(15, 115);
label4.Size = new Size(70, 70);
label4.Text="label4";
label4.ForeColor = Color.Green;
label4.BackColor = Color.LightGray;
this.Controls.Add(label4);
label5 = new Label();
label5.Font = new Font("Times New Roman", 16);
label5.Location= new Point(115, 115);
label5.Size = new Size(70, 70);
label5.Text="label5";
label5.ForeColor = Color.Red;
label5.BackColor = Color.White;
this.Controls.Add(label5);
label6 = new Label();
label6.Font = new Font("Sans Serif", 12);
label6.Location= new Point(215, 115);
label6.Size = new Size(70, 70);
label6.Text="Label6";
label6.ForeColor = Color.Red;
label6.BackColor = Color.White;
label6.Dock = DockStyle.Right;
this.Controls.Add(label6);
this.ResumeLayout(true);
e = new ErrorProvider(this);
e.SetIconAlignment(label1, ErrorIconAlignment.TopLeft);
e.SetError(label1, "label1");
e.SetIconAlignment(label2, ErrorIconAlignment.TopRight);
e.SetError(label2, "label2 error");
e.SetIconAlignment(label3, ErrorIconAlignment.BottomLeft);
e.SetError(label3, "label3 error");
e.SetIconPadding(label3, 5);
e.SetIconAlignment(label4, ErrorIconAlignment.BottomRight);
e.SetError(label4, "label4 error");
e.SetIconAlignment(label5, ErrorIconAlignment.MiddleRight);
e.SetError(label5, "label5 error");
e.SetIconAlignment(label6, ErrorIconAlignment.MiddleLeft);
e.SetError(label6, "label6 error");
t = new System.Windows.Forms.Timer();
t.Tick += new EventHandler(t_Tick);
t.Interval = 5000; // 5 seconds
t.Enabled = true;
}