|
-
Aug 31st, 2000, 04:33 PM
#1
Thread Starter
Lively Member
how do i change the color of selected words? for example, when user wants to change the fontcolor into blue during his editing... the font will be blue starting from then... so that the texts that the user wrote before will stay the same but the new texts will be blue
-
Aug 31st, 2000, 04:36 PM
#2
You mean when using a RichTextBox? If so, the following should work.
Code:
RichTextBox1.SelColor = vbBlue
-
Aug 31st, 2000, 04:44 PM
#3
Thread Starter
Lively Member
thanks for the reply... i guess it was only hard for me
-
Aug 31st, 2000, 04:50 PM
#4
Thread Starter
Lively Member
to make it a little more interesting, how do i show the color palette if the user clicks a button?
-
Aug 31st, 2000, 04:55 PM
#5
Add the following code to a Form with a CommonDialog and a RichTextBox
Code:
Private Sub Command1_Click()
CommonDialog1.Color = RichTextBox1.SelColor
CommonDialog1.ShowColor
RichTextBox1.SelColor = CommonDialog1.Color
RichTextBox1.SetFocus
End Sub
-
Aug 31st, 2000, 04:55 PM
#6
Fanatic Member
Add a CommonDialog and name it Dialog. Now add this code to the command button:
Code:
Dialog.ShowColor
RichTextBox1.Selcolor = Dialog.Color
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|