Proper Lower Upper Case Change TextBox In Visual Basic (vb.net) | Visual Studio Code

0
in this post you can learn how we change the case change in textbox vb.net you can learn from here about three types case change such as proper lower upper as you can see the below coding use the below coding the run your program.



 Private Sub txtUpperCase_TextChanged(ByVal sender As _
    System.Object, ByVal e As System.EventArgs) Handles _
    txtUpperCase.TextChanged
    Dim sel_start As Integer
    Dim sel_length As Integer

    sel_start = txtUpperCase.SelectionStart
    sel_length = txtUpperCase.SelectionLength
    txtUpperCase.Text = txtUpperCase.Text.ToUpper
    txtUpperCase.SelectionStart = sel_start
    txtUpperCase.SelectionLength = sel_length
End Sub

Private Sub txtLowerCase_TextChanged(ByVal sender As _
    System.Object, ByVal e As System.EventArgs) Handles _
    txtLowerCase.TextChanged
    Dim sel_start As Integer
    Dim sel_length As Integer

    sel_start = txtLowerCase.SelectionStart
    sel_length = txtLowerCase.SelectionLength
    txtLowerCase.Text = txtLowerCase.Text.ToLower
    txtLowerCase.SelectionStart = sel_start
    txtLowerCase.SelectionLength = sel_length
End Sub

Private Sub txtProperCase_TextChanged(ByVal sender As _
    System.Object, ByVal e As System.EventArgs) Handles _
    txtProperCase.TextChanged
    Dim sel_start As Integer
    Dim sel_length As Integer

    sel_start = txtProperCase.SelectionStart
    sel_length = txtProperCase.SelectionLength
    txtProperCase.Text = StrConv(txtProperCase.Text, _
        VbStrConv.ProperCase)
    txtProperCase.SelectionStart = sel_start
    txtProperCase.SelectionLength = sel_length
End Sub

Post a Comment

 
Top