same info in two textboxs
i have a text in richtextbox
if user clicked any word a popup menu will be appeared and this code will add the user's choice from that menu to the word and change its formatting
VB Code:
Private Sub mnuWord_Click(Index As Integer)
RichTextBox1.SelColor = vbBlue
RichTextBox1.SelUnderline = True
RichTextBox1.SelText = mnuWord(Index).Caption + " " +RichTextBox1.SelText
End Sub
what i need is that update another textbox which is unvisible
not the text that user is working with
i mean that with the richtext box user can select the word show popup menu choose the option
then that word will be in another color without any changes in the info
and in the hidden textbox the option that user choose will be appear after the word also in different color
how can i do this :wave:
Re: same info in two textboxs
Will this do:
VB Code:
RichTextBox2.TextRTF = RichTextBox1.TextRTF
Re: same info in two textboxs
Just a quick tip. If RichTextBox2 is always hidden, it's better to use a simple String instead of a RichTextBox - it uses less memory:
VB Code:
Option Explicit
Private secondRTB As String
Private Sub RichTextBox1_Change()
secondRTB = RichTextBox1.TextRTF
End Sub