tags:

views:

10

answers:

1

hello, i need to change the selected value to upper case in the richtextbox i use the code

 Dim tou As String
        Dim tot As String

        tou = RichTextBox1.SelectedText

        tot = tou

        RichTextBox1.Text.Replace(tou, "")
        tot = tot.ToUpper
        RichTextBox1.AppendText(tot)

can any one tell where i am wrong and tell me how to do it

A: 

If you want to get the selected text and then convert it to upper case:

Dim toUpper As String = RichTextBox1.SelectedText.ToUpper

If you want to set the selected text to upper case:

RichTextBox1.SelectedText = RichTextBox1.SelectedText.ToUpper
vulkanino