2010-09-15 173 views
0

我需要选择的值更改为大写在我使用的代码RichTextBox的更改所选值上情况下,在RichTextBox中在VB 2008

Dim tou As String 
     Dim tot As String 

     tou = RichTextBox1.SelectedText 

     tot = tou 

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

任何一个可以告诉我哪里错了,并告诉我该怎么办呢

回答

0

如果你想获得选定的文本,然后将其转换为大写:

Dim toUpper As String = RichTextBox1.SelectedText.ToUpper 

如果你想设置选定的文本为大写:

RichTextBox1.SelectedText = RichTextBox1.SelectedText.ToUpper