Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
Button click event not fired after textbox validating event
posted

Sir,

       Please refer attached project.The project with one form which has one button, one text box. that button has one event ultraButton1_Click and ultraTextEditor1_Validating. Please place cursor in ultraTextEditor1 and click the Submit button. Now i get only one message "please enter Name" . But what i expect that form should display two messagebox such as "please enter Name" . and "Submit button clicked" . Why button click event not fired ? How to resolve this Problem ? . Can you give proper reply as soon as possible.

TwoEventsHandle.rar
Parents
No Data
Reply
  • 69832
    Verified Answer
    Offline posted

    The button's Click event does not fire because by showing a MessageBox in the UltraTextEditor's Validating event, you are preventing the MouseUp from being processed by the UltraButton, and for a Click event to happen you need the MouseDown and MouseUp. I bet the same thing happens with the standard .NET TextBox and Button controls.

    If you set the Cancel property of the Validating event's arguments, the cursor will stay in the UltraTextEditor when validation fails, which is the way most developers handle a failed validation.

Children