private void ShowIncubateProcessingTimeError()
 {
     errorIncubateProcessingTime.SetIconAlignment(
         txtIncubateProcessingTime, ErrorIconAlignment.MiddleLeft);
     errorIncubateProcessingTime.SetError(
         txtIncubateProcessingTime, "Incubate processing time must be >= 0");
 }
 private void ShowIterationsCountError()
 {
     errorIterationsCount.SetIconAlignment(
         txtIterationsCount, ErrorIconAlignment.MiddleLeft);
     errorIterationsCount.SetError(
         txtIterationsCount, "Iterations count must be >= 1");
 }
 private void ShowSeparationProcessingTimeError()
 {
     errorSeparationProcessingTime.SetIconAlignment(
         txtSeparationProcessingTime, ErrorIconAlignment.MiddleLeft);
     errorSeparationProcessingTime.SetError(
         txtSeparationProcessingTime, "Separation processing time must be >= 0");
 }
예제 #4
0
        /// <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;
        }
예제 #5
0
 private void ShowCommandExtensionTimeError()
 {
     errorCommandExtensionTime.SetIconAlignment(
         txtCommandExtensionTime, ErrorIconAlignment.MiddleLeft);
     errorCommandExtensionTime.SetError(
         txtCommandExtensionTime, "Command extension time must be >= 0");
 }
예제 #6
0
        private void btnUpdate_Click(object sender, System.EventArgs e)
        {
            if (lstClips.SelectedItem != null && !lstClips.Enabled)
            {
                Clip theClip = (Clip)lstClips.SelectedItem;

                foreach (Clip otherClip in _clips.TextClips)
                {
                    if (otherClip != theClip && otherClip.Name == txtClipName.Text)
                    {
                        errorProvider.SetIconAlignment(txtClipName, ErrorIconAlignment.MiddleLeft);
                        errorProvider.SetError(txtClipName, "Must have a unique clip name");
                        return;
                    }
                }

                theClip.Name    = txtClipName.Text;
                theClip.Content = txtClipText.Text;

                errorProvider.SetError(txtClipName, "");

                enableButtons(false);

                // Force reset of clip data...
                lstClips.Items[lstClips.SelectedIndex] = theClip;

                _clips.Modified = true;
            }
        }
예제 #7
0
        public AddInstrument()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            CategoryErrorProvider = new  System.Windows.Forms.ErrorProvider();
            CategoryErrorProvider.SetIconAlignment(this.comboBoxCategory, ErrorIconAlignment.MiddleRight);
            CategoryErrorProvider.SetIconPadding(this.comboBoxCategory, 2);
            CategoryErrorProvider.BlinkRate  = 300;
            CategoryErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            SubCategoryErrorProvider = new  System.Windows.Forms.ErrorProvider();
            SubCategoryErrorProvider.SetIconAlignment(this.comboBoxSubCategory, ErrorIconAlignment.MiddleRight);
            SubCategoryErrorProvider.SetIconPadding(this.comboBoxSubCategory, 2);
            SubCategoryErrorProvider.BlinkRate  = 300;
            SubCategoryErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            FileNAmeErrorProvider = new  System.Windows.Forms.ErrorProvider();
            FileNAmeErrorProvider.SetIconAlignment(this.comboBoxCategory, ErrorIconAlignment.MiddleRight);
            FileNAmeErrorProvider.SetIconPadding(this.comboBoxCategory, 2);
            FileNAmeErrorProvider.BlinkRate  = 300;
            FileNAmeErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            NAmeErrorProvider = new  System.Windows.Forms.ErrorProvider();
            NAmeErrorProvider.SetIconAlignment(this.comboBoxCategory, ErrorIconAlignment.MiddleRight);
            NAmeErrorProvider.SetIconPadding(this.comboBoxCategory, 2);
            NAmeErrorProvider.BlinkRate  = 300;
            NAmeErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
예제 #8
0
 public frmEditUser(User user)
 {
     InitializeComponent();
     this.user = user;
     err = new ErrorProvider();
     err.BlinkStyle = ErrorBlinkStyle.NeverBlink;
     err.SetIconAlignment(cbRoles, ErrorIconAlignment.MiddleRight);
     err.SetIconPadding(cbRoles, 2);
 }
예제 #9
0
파일: Auxiliary.cs 프로젝트: rafaliusz/main
        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
0
 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();
     };
 }
예제 #11
0
        /// <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);
        }
예제 #12
0
        public AddQuote()
        {
            InitializeComponent();
            //Setup validated error handlers
            this.textWidth.Validated += new System.EventHandler(this.textWidth_Validated);
            this.textDepth.Validated += new System.EventHandler(this.textDepth_Validated);

            //Create and set the ErrorProvider for width data entry control
            textWidthErrorProvider = new System.Windows.Forms.ErrorProvider();
            textWidthErrorProvider.SetIconAlignment(this.textWidth, ErrorIconAlignment.MiddleLeft);
            textWidthErrorProvider.SetIconPadding(this.textWidth, 2);
            textWidthErrorProvider.BlinkRate  = 1000;
            textWidthErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            textDepthErrorProvider = new System.Windows.Forms.ErrorProvider();
            textDepthErrorProvider.SetIconAlignment(this.textDepth, ErrorIconAlignment.MiddleLeft);
            textDepthErrorProvider.SetIconPadding(this.textDepth, 2);
            textDepthErrorProvider.BlinkRate  = 1000;
            textDepthErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;
        }
        /// <summary>
        ///   Shows a blinking icon next to the textbox with an error message. </summary>
        /// <param name="control"></param>
        /// <param name="message">
        ///   The message to show when the cursor is placed over the icon. </param>
        /// <remarks>
        ///   Although doing so is not expected, this method may be overriden by derived classes. </remarks>
        private void ShowErrorIcon(Control control, string message)
        {
            if (control == null)
            {
                return;
            }

            if (m_errorProvider == null)
            {
                if (string.IsNullOrEmpty(message))
                {
                    return;
                }
                m_errorProvider            = new ErrorProvider();
                m_errorProvider.BlinkRate  = 500;
                m_errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;
            }
            m_errorProvider.SetIconAlignment(control, ErrorIconAlignment.MiddleRight);
            m_errorProvider.SetIconPadding(control, 0);
            m_errorProvider.SetError(control, message);
        }
        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;
        }
예제 #15
0
        public Form1()
        {
            this.nameTextBox1          = new System.Windows.Forms.TextBox();
            this.label1                = new System.Windows.Forms.Label();
            this.label2                = new System.Windows.Forms.Label();
            this.ageUpDownPicker       = new System.Windows.Forms.NumericUpDown();
            this.favoriteColorComboBox = new System.Windows.Forms.ComboBox();
            this.label3                = new System.Windows.Forms.Label();
            this.label4                = new System.Windows.Forms.Label();
            this.label5                = new System.Windows.Forms.Label();
            this.label6                = new System.Windows.Forms.Label();

            // Name Label
            this.label1.Location = new System.Drawing.Point(56, 32);
            this.label1.Size     = new System.Drawing.Size(40, 23);
            this.label1.Text     = "Name:";

            // Age Label
            this.label2.Location = new System.Drawing.Point(40, 64);
            this.label2.Size     = new System.Drawing.Size(56, 23);
            this.label2.Text     = "Age (3-5)";

            // Favorite Color Label
            this.label3.Location = new System.Drawing.Point(24, 96);
            this.label3.Size     = new System.Drawing.Size(80, 24);
            this.label3.Text     = "Favorite color";

            // ErrorBlinkStyle.AlwaysBlink Label
            this.label4.Location = new System.Drawing.Point(264, 32);
            this.label4.Size     = new System.Drawing.Size(160, 23);
            this.label4.Text     = "ErrorBlinkStyle.AlwaysBlink";

            // ErrorBlinkStyle.BlinkIfDifferentError Label
            this.label5.Location = new System.Drawing.Point(264, 64);
            this.label5.Size     = new System.Drawing.Size(200, 23);
            this.label5.Text     = "ErrorBlinkStyle.BlinkIfDifferentError";

            // ErrorBlinkStyle.NeverBlink Label
            this.label6.Location = new System.Drawing.Point(264, 96);
            this.label6.Size     = new System.Drawing.Size(200, 23);
            this.label6.Text     = "ErrorBlinkStyle.NeverBlink";

            // Name TextBox
            this.nameTextBox1.Location   = new System.Drawing.Point(112, 32);
            this.nameTextBox1.Size       = new System.Drawing.Size(120, 20);
            this.nameTextBox1.TabIndex   = 0;
            this.nameTextBox1.Validated += new System.EventHandler(this.nameTextBox1_Validated);

            // Age NumericUpDown
            this.ageUpDownPicker.Location   = new System.Drawing.Point(112, 64);
            this.ageUpDownPicker.Maximum    = new System.Decimal(new int[] { 150, 0, 0, 0 });
            this.ageUpDownPicker.TabIndex   = 4;
            this.ageUpDownPicker.Validated += new System.EventHandler(this.ageUpDownPicker_Validated);

            // Favorite Color ComboBox
            this.favoriteColorComboBox.Items.AddRange(new object[] { "None", "Red", "Yellow",
                                                                     "Green", "Blue", "Purple" });
            this.favoriteColorComboBox.Location   = new System.Drawing.Point(112, 96);
            this.favoriteColorComboBox.Size       = new System.Drawing.Size(120, 21);
            this.favoriteColorComboBox.TabIndex   = 5;
            this.favoriteColorComboBox.Validated += new System.EventHandler(this.favoriteColorComboBox_Validated);

            // Set up how the form should be displayed and add the controls to the form.
            this.ClientSize = new System.Drawing.Size(464, 150);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
                this.label6, this.label5, this.label4, this.label3,
                this.favoriteColorComboBox, this.ageUpDownPicker,
                this.label2, this.label1, this.nameTextBox1
            });
            this.Text = "Error Provider Example";

            //<Snippet2>
            // Create and set the ErrorProvider for each data entry control.

            nameErrorProvider = new  System.Windows.Forms.ErrorProvider();
            nameErrorProvider.SetIconAlignment(this.nameTextBox1, ErrorIconAlignment.MiddleRight);
            nameErrorProvider.SetIconPadding(this.nameTextBox1, 2);
            nameErrorProvider.BlinkRate  = 1000;
            nameErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;

            ageErrorProvider = new  System.Windows.Forms.ErrorProvider();
            ageErrorProvider.SetIconAlignment(this.ageUpDownPicker, ErrorIconAlignment.MiddleRight);
            ageErrorProvider.SetIconPadding(this.ageUpDownPicker, 2);
            ageErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.BlinkIfDifferentError;

            favoriteColorErrorProvider = new  System.Windows.Forms.ErrorProvider();
            favoriteColorErrorProvider.SetIconAlignment(this.favoriteColorComboBox, ErrorIconAlignment.MiddleRight);
            favoriteColorErrorProvider.SetIconPadding(this.favoriteColorComboBox, 2);
            favoriteColorErrorProvider.BlinkRate  = 1000;
            favoriteColorErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
            //</Snippet2>
        }
예제 #16
0
        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);
        }
 /// <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);
     }
 }
        /// <summary>
        /// Processes the control.
        /// </summary>
        /// <param name="control">The control.</param>
        private void ProcessControl(Control control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            bool hasWarning = false;
            bool hasInfo    = false;

            var sbError = new StringBuilder();
            var sbWarn  = new StringBuilder();
            var sbInfo  = new StringBuilder();

            foreach (Binding binding in control.DataBindings)
            {
                // get the Binding if appropriate
                if (binding.DataSource == DataSource)
                {
                    string propertyName = binding.BindingMemberInfo.BindingField;

                    if (_errorList.ContainsKey(propertyName))
                    {
                        sbError.AppendLine(_errorList[propertyName]);
                    }
                    if (_warningList.ContainsKey(propertyName))
                    {
                        sbWarn.AppendLine(_warningList[propertyName]);
                    }
                    if (_infoList.ContainsKey(propertyName))
                    {
                        sbInfo.AppendLine(propertyName);
                    }
                }
            }

            bool bError = sbError.Length > 0;
            bool bWarn  = sbWarn.Length > 0;
            bool bInfo  = sbInfo.Length > 0;

            // set flags to indicat if Warning or Info is highest severity; else false
            if (_showMostSevereOnly)
            {
                bInfo = bInfo && !bWarn && !bError;
                bWarn = bWarn && !bError;
            }

            int offsetInformation = _offsetInformation;
            int offsetWarning     = _offsetWarning;

            // Set / fix offsets
            // by default the setting are correct for Error (0), Warning and Info
            if (!bError)
            {
                if (bWarn)
                {
                    // warning and possibly info, no error
                    offsetInformation = _offsetInformation - _offsetWarning;
                    offsetWarning     = 0;
                }
                else
                {
                    // Info only
                    offsetInformation = 0;
                }
            }
            else if (!bWarn)
            {
                offsetInformation = _offsetInformation - _offsetWarning;
            }


            // should warning be visible
            if (_showWarning && bWarn)
            {
                _errorProviderWarn.SetError(control, sbWarn.ToString());
                _errorProviderWarn.SetIconPadding(control,
                                                  base.GetIconPadding(control) +
                                                  offsetWarning);
                _errorProviderWarn.SetIconAlignment(control,
                                                    base.GetIconAlignment(control));
                hasWarning = true;
            }

            // should info be shown
            if (_showInformation && bInfo)
            {
                _errorProviderInfo.SetError(control, sbInfo.ToString());
                _errorProviderInfo.SetIconPadding(control,
                                                  base.GetIconPadding(control) +
                                                  offsetInformation);
                _errorProviderInfo.SetIconAlignment(control,
                                                    base.GetIconAlignment(control));

                hasInfo = true;
            }

            if (!hasWarning)
            {
                _errorProviderWarn.SetError((Control)control, string.Empty);
            }
            if (!hasInfo)
            {
                _errorProviderInfo.SetError((Control)control, string.Empty);
            }
        }
예제 #19
0
 private void ShowCommandLabelError()
 {
     errorCommandLabel.SetIconAlignment(txtCommandLabel, ErrorIconAlignment.MiddleLeft);
     errorCommandLabel.SetError(txtCommandLabel, "Command label required");
 }
예제 #20
0
		public void GetandSetIconAlignmentTest ()
		{
			TextBox myTextBox = new TextBox ();
			ErrorProvider myErrorProvider = new ErrorProvider ();
			myErrorProvider.SetIconAlignment (myTextBox, ErrorIconAlignment.MiddleRight);
			Assert.AreEqual (ErrorIconAlignment.MiddleRight, myErrorProvider.GetIconAlignment (myTextBox), "#getset2");
		}
        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);
        }
 internal void SetUserNameError(ErrorProvider errorProvider, string errroMessage)
 {
     errorProvider.SetIconAlignment(this.cmbUsers, ErrorIconAlignment.MiddleRight);
     errorProvider.SetError(this.cmbUsers, errroMessage);
 }
예제 #23
0
		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");
		}
예제 #24
0
파일: Auxiliary.cs 프로젝트: rafaliusz/main
 public static void SetErrorProvider(ErrorProvider ep, Control tb)
 {
     ep.SetIconAlignment(tb, ErrorIconAlignment.MiddleRight);
     ep.SetIconPadding(tb, 2);
 }
예제 #25
0
파일: ParamError.cs 프로젝트: sv99/DVSDK
        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;

            sdramSdrsrpdexit = new ErrorProvider();
            sdramSdrsrpdexit.SetIconAlignment(parent.textBoxSDRAMsdrsrpdexit, ErrorIconAlignment.MiddleRight);
            sdramSdrsrpdexit.SetIconPadding(parent.textBoxSDRAMsdrsrpdexit, 2);
            sdramSdrsrpdexit.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            sdramSdrcr = new ErrorProvider();
            sdramSdrcr.SetIconAlignment(parent.textBoxSDRAMsdrcr, ErrorIconAlignment.MiddleRight);
            sdramSdrcr.SetIconPadding(parent.textBoxSDRAMsdrcr, 2);
            sdramSdrcr.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            // pll1 tab errors
            pll1postDiv = new ErrorProvider();
            pll1postDiv.SetIconAlignment(parent.textBoxPLL1postDiv, ErrorIconAlignment.MiddleRight);
            pll1postDiv.SetIconPadding(parent.textBoxPLL1postDiv, 2);
            pll1postDiv.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            pll1mult = new ErrorProvider();
            pll1mult.SetIconAlignment(parent.textBoxPLL1mult, ErrorIconAlignment.MiddleRight);
            pll1mult.SetIconPadding(parent.textBoxPLL1mult, 2);
            pll1mult.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            pll1div1 = new ErrorProvider();
            pll1div1.SetIconAlignment(parent.textBoxPLL1div1, ErrorIconAlignment.MiddleRight);
            pll1div1.SetIconPadding(parent.textBoxPLL1div1, 2);
            pll1div1.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            pll1div2 = new ErrorProvider();
            pll1div2.SetIconAlignment(parent.textBoxPLL1div2, ErrorIconAlignment.MiddleRight);
            pll1div2.SetIconPadding(parent.textBoxPLL1div2, 2);
            pll1div2.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            pll1div3 = new ErrorProvider();
            pll1div3.SetIconAlignment(parent.textBoxPLL1div3, ErrorIconAlignment.MiddleRight);
            pll1div3.SetIconPadding(parent.textBoxPLL1div3, 2);
            pll1div3.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            pll1ddr2 = new ErrorProvider();
            pll1ddr2.SetIconAlignment(parent.textBoxPLL1ddr2, ErrorIconAlignment.MiddleRight);
            pll1ddr2.SetIconPadding(parent.textBoxPLL1ddr2, 2);
            pll1ddr2.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            // ddr2 tab errors
            ddr2Clock = new ErrorProvider();
            ddr2Clock.SetIconAlignment(parent.textBoxDDR2clock, ErrorIconAlignment.MiddleRight);
            ddr2Clock.SetIconPadding(parent.textBoxDDR2clock, 2);
            ddr2Clock.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            ddr2phy = new ErrorProvider();
            ddr2phy.SetIconAlignment(parent.textBoxDDR2phy, ErrorIconAlignment.MiddleRight);
            ddr2phy.SetIconPadding(parent.textBoxDDR2phy, 2);
            ddr2phy.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            ddr2sdcr = new ErrorProvider();
            ddr2sdcr.SetIconAlignment(parent.textBoxDDR2sdcr, ErrorIconAlignment.MiddleRight);
            ddr2sdcr.SetIconPadding(parent.textBoxDDR2sdcr, 2);
            ddr2sdcr.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            ddr2sdtimr = new ErrorProvider();
            ddr2sdtimr.SetIconAlignment(parent.textBoxDDR2sdtimr, ErrorIconAlignment.MiddleRight);
            ddr2sdtimr.SetIconPadding(parent.textBoxDDR2sdtimr, 2);
            ddr2sdtimr.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            ddr2sdtimr2 = new ErrorProvider();
            ddr2sdtimr2.SetIconAlignment(parent.textBoxDDR2sdtimr2, ErrorIconAlignment.MiddleRight);
            ddr2sdtimr2.SetIconPadding(parent.textBoxDDR2sdtimr2, 2);
            ddr2sdtimr2.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            ddr2sdrcr = new ErrorProvider();
            ddr2sdrcr.SetIconAlignment(parent.textBoxDDR2sdrcr, ErrorIconAlignment.MiddleRight);
            ddr2sdrcr.SetIconPadding(parent.textBoxDDR2sdrcr, 2);
            ddr2sdrcr.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            // lpsc tab errors
            lpsc0enable = new ErrorProvider();
            lpsc0enable.SetIconAlignment(parent.textBoxLps0Enable, ErrorIconAlignment.MiddleRight);
            lpsc0enable.SetIconPadding(parent.textBoxLps0Enable, 2);
            lpsc0enable.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            lpsc0disable = new ErrorProvider();
            lpsc0disable.SetIconAlignment(parent.textBoxLps0Disable, ErrorIconAlignment.MiddleRight);
            lpsc0disable.SetIconPadding(parent.textBoxLps0Disable, 2);
            lpsc0disable.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            lpsc0syncRst = new ErrorProvider();
            lpsc0syncRst.SetIconAlignment(parent.textBoxLps0SyncRst, ErrorIconAlignment.MiddleRight);
            lpsc0syncRst.SetIconPadding(parent.textBoxLps0SyncRst, 2);
            lpsc0syncRst.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            lpsc1enable = new ErrorProvider();
            lpsc1enable.SetIconAlignment(parent.textBoxLps1Enable, ErrorIconAlignment.MiddleRight);
            lpsc1enable.SetIconPadding(parent.textBoxLps1Enable, 2);
            lpsc1enable.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            lpsc1disable = new ErrorProvider();
            lpsc1disable.SetIconAlignment(parent.textBoxLps1Disable, ErrorIconAlignment.MiddleRight);
            lpsc1disable.SetIconPadding(parent.textBoxLps1Disable, 2);
            lpsc1disable.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            lpsc1syncRst = new ErrorProvider();
            lpsc1syncRst.SetIconAlignment(parent.textBoxLps1SyncRst, ErrorIconAlignment.MiddleRight);
            lpsc1syncRst.SetIconPadding(parent.textBoxLps1SyncRst, 2);
            lpsc1syncRst.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

            // pinmux tab errors
            pinmux = new ErrorProvider[PINMUX_cnt];
            for (int i = 0; i < PINMUX_cnt; i++)
            {
                pinmux[i] = new ErrorProvider();
                pinmux[i].SetIconAlignment(parent.textBoxPinmux[i], ErrorIconAlignment.MiddleRight);
                pinmux[i].SetIconPadding(parent.textBoxPinmux[i], 2);
                pinmux[i].BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
            }

            // flash tab errors
            flashTiming = new ErrorProvider();
            flashTiming.SetIconAlignment(parent.textBoxFlashTiming, ErrorIconAlignment.MiddleRight);
            flashTiming.SetIconPadding(parent.textBoxFlashTiming, 2);
            flashTiming.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
        }
예제 #26
0
        /// <summary>
        /// Проверить корректность данных в полях
        /// </summary>
        public bool CheckCorrectnessData()
        {
            var correct = true;

            try
            {
                Contact.Surname = textBoxSurname.Text;                              //SURNAME
            }
            catch (ArgumentException exception)
            {
                surNameToolTip.SetToolTip(textBoxSurname, exception.Message);
                textBoxSurname.BackColor = Color.LightCoral;
                correct = false;
            }
            try
            {
                Contact.Name = textBoxName.Text;                                    //Name
            }
            catch (ArgumentException exception)
            {
                nameToolTip.SetToolTip(textBoxName, exception.Message);
                textBoxName.BackColor = Color.LightCoral;
                correct = false;
            }
            try
            {
                _dateSize        = dateTimeBirthDay.ClientSize;
                Contact.BirthDay = dateTimeBirthDay.Value;                           //BirthDay
            }
            catch (ArgumentException exception)
            {
                if (_sizeLess)
                {
                    _dateSize = Size.Subtract(_dateSize, new Size(20, 0));
                    _sizeLess = false;
                }
                dateTimeBirthDay.Size = _dateSize;
                dateErrorProvider.SetIconAlignment(dateTimeBirthDay, ErrorIconAlignment.MiddleRight);
                dateErrorProvider.SetIconPadding(dateTimeBirthDay, 2);
                dateErrorProvider.BlinkStyle = ErrorBlinkStyle.AlwaysBlink;
                dateErrorProvider.SetError(dateTimeBirthDay, exception.Message);
                correct = false;
            }
            try
            {
                Contact.PhoneNumber.Number = textBoxPhone.Text;                              //Phone
            }
            catch (ArgumentException exception)
            {
                phoneToolTip.SetToolTip(textBoxPhone, exception.Message);
                textBoxPhone.BackColor = Color.LightCoral;
                correct = false;
            }
            try
            {
                Contact.EMail = textBoxEMail.Text;                              //Email
            }
            catch (ArgumentException exception)
            {
                eMailToolTip.SetToolTip(textBoxEMail, exception.Message);
                textBoxEMail.BackColor = Color.LightCoral;
                correct = false;
            }
            try
            {
                Contact.VkPage = textBoxVK.Text;                              //VkPage
            }
            catch (ArgumentException exception)
            {
                vkToolTip.SetToolTip(textBoxVK, exception.Message);
                textBoxVK.BackColor = Color.LightCoral;
                correct             = false;
            }
            return(correct);
        }
예제 #27
0
		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;
		}
 internal void SetErrorProviderIconsAlignment(ErrorProvider errorProvider)
 {
     errorProvider.SetIconAlignment(this.cmbServers, ErrorIconAlignment.MiddleLeft);
     errorProvider.SetIconAlignment(this.httpUrlTextBox, ErrorIconAlignment.MiddleLeft);
     errorProvider.SetIconAlignment(this.txtName, ErrorIconAlignment.MiddleLeft);
 }