Click here to Skip to main content
16,010,918 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have using this function for the web-gui commponents

VB
Shared Sub TextBox_LostFocus(ByRef pTextBox As TextBox, Optional ByVal NumDigitsAfterDecimal As Integer = 2, Optional ByVal err As ErrorProvider = Nothing)

        If Not err Is Nothing Then
            err.SetError(pTextBox, "")
        End If

        If pTextBox.Text.Trim.Length = 0 Then
            pTextBox.Text = 0
        End If

        Try
            pTextBox.Text = FormatNumber(pTextBox.Text, NumDigitsAfterDecimal)
            pTextBox.Tag = pTextBox.Text
        Catch ex As Exception
            If Not err Is Nothing Then
                err.SetError(pTextBox, "Incorrect Amount Format!")
            End If
        End Try

    End Sub



but i am not be able to use the same function for the dev-express controls

plz help me to convert this code for use my dev-express controls

already i had try this code

VB
Shared Sub ASPxTextBox_LostFocus(ByRef pTextBox As DevExpress.Web.ASPxEditors.ASPxTextBox, Optional ByVal NumDigitsAfterDecimal As Integer = 2, Optional ByVal err As DevExpress.ExpressApp.Web.Templates.Controls.ErrorInfoControl = Nothing)

        If Not err Is Nothing Then
            err.Caption = ""
        End If

        If pTextBox.Text.Trim.Length = 0 Then
            pTextBox.Text = 0
        End If

        Try
            pTextBox.Text = FormatNumber(pTextBox.Text, NumDigitsAfterDecimal)
            'pTextBox.Tag = pTextBox.Text
        Catch ex As Exception
            If Not err Is Nothing Then
                err.Caption = "Incorrect Amount Format!"
            End If
        End Try

    End Sub


but it is not working.now plz help out me
Posted
Updated 6-Sep-12 1:56am
v3
Comments
[no name] 6-Sep-12 7:55am    
"use the same function for the dev-express controls" and why not?
Sandeep Mewara 6-Sep-12 12:37pm    
Why? Any error?
Sergey Alexandrovich Kryukov 6-Sep-12 14:12pm    
There is no such thing as "dev-express control". What are you trying to achieve?
--SA
prince_rumeel 7-Sep-12 2:58am    
Dear friends thanks for your reply.
My main problem is that i want to write lost_focus and got_focus event for the Dev-Express Text-box
By Defualt there is not Any event like this

So i am trying to write my own event...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900