in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

prevalidating for required fields

Last post 05-16-2008 6:38 AM by C1_JohnAd. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-27-2007 5:58 AM

    prevalidating for required fields

    Hi,
    C1TextBox normally fire validation when the user leaves control, BUT ONLY if there is something in Text property. I want to check if textbox is empty and to avoid that. How to do this?
    Thanx in advance,
    savgoran
  • 05-16-2008 6:38 AM In reply to

    Re: prevalidating for required fields

    Hi,

    You can implement the desired behavior using the LostFocus event of
    C1TextBox. Below is the code snippet for the same:

    BEGIN CODE

    Private Sub C1TextBox1_LostFocus(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles C1TextBox1.LostFocus

    If Me.C1TextBox1.Text = "" Then

    MsgBox("Text Box is empty")

    Me.C1TextBox1.Focus()

    Else

    MsgBox("Text Box is not empty")

    End If

    End Sub

    END CODE

    Hope this helps.

    Regards,
    John Adams

    wrote in message news:192853@10.0.1.98...
    Hi,
    C1TextBox normally fire validation when the user leaves control, BUT ONLY if
    there is something in Text property. I want to check if textbox is empty and
    to avoid that. How to do this?
    Thanx in advance,
    savgoran


    http://helpcentral.componentone.com/cs/forums/p/70736/192853.aspx#192853
Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.