![]() NameErrorProvider->SetIconPadding( this->nameTextBox1, 2 ) ![]() NameErrorProvider->SetIconAlignment( this->nameTextBox1, ErrorIconAlignment::MiddleRight ) NameErrorProvider = gcnew System::Windows::Forms::ErrorProvider Create and set the ErrorProvider for each data entry control. This->ageUpDownPicker->Validated += gcnew System::EventHandler( this, &Form1::ageUpDownPicker_Validated ) Īrray^temp1 = This->ageUpDownPicker->Maximum = System::Decimal( temp0 ) This->ageUpDownPicker->Location = System::Drawing::Point( 112, 64 ) This->nameTextBox1->Validated += gcnew System::EventHandler( this, &Form1::nameTextBox1_Validated ) This->nameTextBox1->Size = System::Drawing::Size( 120, 20 ) This->nameTextBox1->Location = System::Drawing::Point( 112, 32 ) This->label6->Text = "ErrorBlinkStyle::NeverBlink" This->label6->Location = System::Drawing::Point( 264, 96 ) This->label5->Text = "ErrorBlinkStyle::BlinkIfDifferentError" This->label5->Location = System::Drawing::Point( 264, 64 ) ErrorBlinkStyle::BlinkIfDifferentError Label This->label4->Text = "ErrorBlinkStyle::AlwaysBlink" This->label4->Location = System::Drawing::Point( 264, 32 ) This->label3->Location = System::Drawing::Point( 24, 96 ) This->label2->Location = System::Drawing::Point( 40, 64 ) ![]() This->label1->Location = System::Drawing::Point( 56, 32 ) This->label6 = gcnew System::Windows::Forms::Label This->label5 = gcnew System::Windows::Forms::Label This->label4 = gcnew System::Windows::Forms::Label This->label3 = gcnew System::Windows::Forms::Label This->favoriteColorComboBox = gcnew System::Windows::Forms::ComboBox This->ageUpDownPicker = gcnew System::Windows::Forms::NumericUpDown This->label2 = gcnew System::Windows::Forms::Label This->label1 = gcnew System::Windows::Forms::Label This->nameTextBox1 = gcnew System::Windows::Forms::TextBox System::Windows::Forms::ErrorProvider^ favoriteColorErrorProvider System::Windows::Forms::ErrorProvider^ nameErrorProvider System::Windows::Forms::ErrorProvider^ ageErrorProvider System::Windows::Forms::ComboBox^ favoriteColorComboBox System::Windows::Forms::NumericUpDown^ ageUpDownPicker System::Windows::Forms::TextBox^ nameTextBox1 Public ref class Form1: public System::Windows::Forms::Form The SetError method is called with or without appropriate error text during a control's Validated event, depending upon the content in the control. The example sets error icon options using the BlinkRate and BlinkStyle properties and the SetIconAlignment and SetIconPadding methods. The example creates a Form that contains a TextBox control, a NumericUpDown control, and a ComboBox control, each validating its content, and an ErrorProvider for each control. To clear an error message, pass an empty string to the method, using the same control as a parameter.The following code example demonstrates using the ErrorProvider class to notify the user of a data entry error. Use the SetError method to display the error icon next to the target control and display a specified error message when the user hovers the mouse over the error icon. This method sets the error description string for the specified control. This property controls whether the error icon blinks when an error is set.īlinks when the icon is already displayed and a new error string is set for the control.Īlways blinks when the error icon is first displayed, or when an error description string is set for the control and the error icon is already displayed. Use this property to increase or decrease the blink rate of the icon. This property controls the rate in milliseconds at which the error icon blinks. Use this property to change the icon used to indicate an error. In the case where you wish to display different icons or styles, you will need to use multiple ErrorProvider controls. You can use a single ErrorProvider for multiple controls. Use the ErrorProvider if you want to notify the user that there is an input error by flashing an icon next to the input control. Provides a user interface for indicating that a control on a form has an error associated with it. User Rating: 5 / 5 Please Rate ErrorProvider Control
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |