The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am using an inputbox to allow the user to input some value.
If the user doesnt enter anything and clicks OK Button, i want to display a message box asking for input and show the same input box again.
If the user doesnt enter anything and clicks cancel button, then no messagebox to be displayed. How do i get through this?
RPRamesh Praveen Syncfusion Team June 25, 2003 11:44 AM UTC
Listen to the OK button's click event, and if a valid value is not in the textbox, fire a message box and then set the focus back to the textbox; otherwise close the dialog by setting it's DialogResult value approriately. Note that the DialogResult property for this button control should be set to None.
-Praveen
RPRamesh Praveen Syncfusion Team June 25, 2003 11:56 AM UTC
RPRamesh Praveen Syncfusion Team June 25, 2003 12:12 PM UTC
Here is another way of doing it:
private void TextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
if (!this.cancelButton_.Focused)
{
// Do this only when the cancel button is not clicked.
if(invalidState)
e.Cancel = true;
}
}