Rich Textbox Font Color
I made a chat window for my chat program that when it loads up, it's
rich textbox color alway reverts back to black.
What the chat form does is when you click on the send button, the
message is sent and then the form is unloaded. I have public variables
in place to hold all the font properties. When the user sends a message
back, the chat form or message box loads back up, displaying the new
message. In the form load event, the font properties are reloaded with
the values already held in the public font variables and everything works
except for the font color.
My problem is that even if i have my font color set to red, when the form
loads back up, the rich textbox font color always goes back to black.
I've heard and experienced myself that the rich textbox has flaws in it.
For instance, if the font color is set to red and i change the font bold
property, the font color goes back to black.
I was just wondering if there is a way to subclass the rich textbox to
get it's font color property instead of the Selcolor property.
I noticed the rich textbox has font.bold, font.italic, font.underline and
font.size properties but not font.color. I wonder why?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Changing The Font Color Of A Rich Textbox
how can I change the font color of a rich textbox? I've tried looking for "forecolor" option but there's none...
Edited by - gen23 on 5/6/2004 10:44:28 PM
Rich Text Box Change Font Color
I have a sub that reads in and changes the selcolor of a rich text box.
The code executes fine and if i run the code and then write in the rich text box the text is the color set by the selcolor but if i click on a button i have set up that simply enters some text into the rich text box the text color stays black (its original color)
what do i need to do to get the text to change to the set color when it is entered like it does when its written in.
Changing Font Color In Rich Text Box
Hi, can u tell me how to change the font color in rich text box control..
I want few
line color to in red
and few in blue
and few in black.
how to get this.
thanks in adv.
Rich TextBox Font ???
Can anyone help me, I don't know how to use a rich text box. I only want to display text in different fonts, but I have no clue how???
Rich TextBox (Khmer Font)
I use Rich TextBox in Vb6 to view khmer font (Limon S2) it can see but it seem to be loose so how can i make it near each other.
Thank in adcance.
My emial : firstname.lastname@example.org;email@example.com
Set Font Size On Rich TextBox
When I set font size of text on a Rich TextBox (txtMainScreen), the actual font size was different form what I want it be. My code looks like this:
Dim tmp As Single
txtMainScreen.Font.Name = "courier new"
tmp = 16
frmMainForm.Font.Size = tmp
txtMainScreen.Font.Size = frmMainForm.Font.Size
'check out for the result
sbrStatus.Panels("Check") = Str(tmp) + Str(frmMainForm.Font.Size) + Str(txtMainScreen.Font.Size)
'then, the result is:
'if tmp=15, then
' Str(tmp)= Str(frmMainForm.Font.Size)=Str(txtMainScreen.Font.Size)=15
Is there anyone help me to solve the problem? Thanks!
My email address is email me
Rich Textbox Color
I have a slight problem. I am loading data from MySQL into a richtext box (only 5 records). If something in a MySQL field is true, I want the rich textbox to highlight the text being added to the RTB to be red...if not...default black. Below is my code:
Do Until rsMySQL.BOF = True If Format(rsMySQL.Fields("ActionDate"), "yyyy-mm-dd") = Format(Date, "yyyy-mm-dd") Then 'Debug.Print "dasd" Debug.Print "meep: " & TimeDiff(rsMySQL.Fields("ActionTime"), Time) If TimeDiff(rsMySQL.Fields("ActionTime"), Time) <= 20 Then txtComments.SelColor = 255 Else txtComments.SelColor = 0 End If End If 'txtComments.SelColor = 255 txtComments.Text = txtComments.Text & "** " & rsMySQL("Comment") & " ---" & rsMySQL("ActionTime") & "---" & rsMySQL("ActionDate") & "---" & "**" & vbNewLine & vbNewLine rsMySQL.MovePrevious Loop
Why won't my color change?
TextBox Color And Font
I have a text in the TextBox, the text color is black and font size is 8.
How can I change the color and the font size only for one word or one letter in the text?
Font Color For A Disabled Textbox
I have a text field that I put information into and want to highlight the field, blue background with white text.
This works fine
txtGus.BackColor = &HFF0000
txtGus.ForeColor = &H80000009
When I set the text box enabled to false, the text color is always grey.
txtGus.BackColor = &HFF0000
txtGus.ForeColor = &H80000009
txtGus.Enabled = False
Is there a way to change the forecolor for a disabled text box?
Chaning Textbox Font Name, Size And Color At Run Time?
How can i do this?
I have the options in a text box. Here is what I have been trying...
Textbox named "Inpt"
ComboBox named "FontBox"
For now, ill have one item in the box, "Times New Roman."
Here is my code...
Private Sub FontBox_Change()
Dim FontName As String
FontName = FontBox
Inpt.FontName = FontName
Private Sub Form_Load()
FontBox.AddItem "Times New Roman"
Private Sub mnuExit_Click()
Private Sub mnuNew_Click()
Inpt.Text = ""
Changing Enabled = False Textbox Font Color
i am new to visual basic.
i have set a textbox's enabled properties to false.
the text color in the textbox appear to be grayish, although i have tried to change the forecolor to black.
is there anyway i can get back the font appearing in that textbook to be in black color even after i disabled it?
HOW TO Change The Font Color Of A Textbox Control That Has ENABLE Set To FALSE?
I have textbox controls that have property ENABLE set to FALSE to prevent user from changing the content. The default font color is set to gray. But I want the font color to be something else. I try to change the font color property but it didn't do any good. How to overcome this?
Edited by - tabbey on 5/19/2005 11:53:58 AM
Changing Textbox Text Font Type/Size, Bold, Italic, Underline And Color
Hi everyone, this is urgent.
I have a textbox where user can type in there. When user select (highlight) the text they can change the font, size, Bold, Italic, Underline and/or color. It should work like in MS Word.
How do I do this? I have a combo box for Fonts, a combo box for Size, and 4 command buttons for B, I, U, and Color.
Detecting The Current Font And Font Size On Various Lines In A Rich Text Box.
I have written an editor that uses a rich text box as the main text area.
The editor allows the user to select a font and font size on the toolbar.
My question is, how does one get the combo box text (for both the font and font size) to display the font or font size for the current line of the current character location?
Meaning, if I were to type in two lines, the first line being Arial 12pt, and the second line being Tahoma 14pt, how would I get the program to display the font and font size in the combo boxes?
I know about SelFont, SelStart and such, but I am not selecting any text. I am merely moving the cursor up or down and need to be able to display the font and font size for where the cursor currently is.
Anyone have any ideas?
I thank you in advance.
Detecting Font And Font Size On Various Lines In A Rich Text Box.
I have written a basic editor that uses fonts and such, however when I select a different line (while entering text into the text area of the rich text box), it doesn't display the font or font size for that particular location.
Does anyone have any ideas where I can look to solve this problem?
I thank you in advance for any information you may be able to share with me.
How To Save Text Fontsize, Font Style And Font Color
When I save the text in a Richtextbox to a Access Database, How to save the font style and Font color with the text (Assume that user can change font style and color when they typing text into the richtextbox).
Then when I load the text from Access Database back to the Richtextbox, it should associate with it's font style and color when I was saved.
How to realize these functions???
Thanks in advance
Changing Back Color Or Font Color Of DTP
I have a DTP whose value is being populated from Access 2003 database. I require that if the year value is less than 1951 then it should have a backgroundcolor as vbred or atleast the font displayed should change to vbred. I tried the below code line in change & click event of DTP but to no effect. I did not use both codes together or use the codes in both the events simultaneously.
If Year(Me.dtp1.Value) <= 1950 Then Me.dtp1.CalendarForeColor = vbRedIf Year(Me.dtp1.Value) <= 1950 Then Me.dtp1.CalendarBackColor = vbred
could somebody help me.
Rich Text Boxes (font)
I am trying for the life of me to get my RTB to display Bold font, I would also like to change size as well.
But the code gods are not favoring me today
Dim Fonter As StdFont With Fonter 'I know this looks funny now but one I get this.Bold = True 'working there will be moreEnd WithSet rtbInSum.Font = Fonter TempHold = Format(InExtensionTotalInWrite).TotalCharge, "###,##0.00")rtbInSum.Text = rtbInSum.Text & Chr$(32) & Chr$(32) & Chr$(32) & Chr$(32) & Chr$(32) & Chr$(32) & _Trim(InExtensionTotal(InWrite).Extension) & Chr$(9) & Chr$(9) & Chr$(9) & Chr$(9) & Chr$(9) & Chr$(9) & _Chr$(9) & Trim(InExtensionTotal(InWrite).Minutes) & Chr$(9) & Chr$(9) & Chr$(9) & Chr$(9) & Chr$(9) & _Chr$(9) & "$" & Trim(TempHold) & Chr$(13) & Chr$(10)
When I run this it displays................nothing!
anyone have any Ideas?
Change Font In A Rich Text Box
I am trying to make a font be applied to an rtb. proplem is, when i use the common dialog, it tells i have no fonts installed. I am currently using this:
On Error Resume Next
If ActiveForm Is Nothing Then Exit Sub
.DialogTitle = "Font"
.CancelError = True
.Flags = cdlPDReturnDC + cdlPDNoPageNums
If ActiveForm.rtfText.SelLength = 0 Then
.Flags = .Flags + cdlPDAllPages
.Flags = .Flags + cdlPDSelection
If Err <> MSComDlg.cdlCancel Then
An help would be appreciated
Change Of Font In Rich Text Box
I wanted to change the font of the selected text in rich text box, but it changes the font for whole rich text box. Can i change the font for selected text as well as can i underline selected text in rich text box.
I am creating a notepad for my computer class project in which i used rich text box as a editable document. Does any one have other solution.
Thanking in anticipation.
Changing Font Properties In Rich Text Box
I am making an application in which the computer will dialog with the user about any problem and the user can answer in "yes" or "no".
I have used rich text box for displaying the conversation. Now i want that whatever questions asked by computer should appear as bold and italic and the answer by user (yes or no) apear in noramal text with a different colour. (like chating software msn or yahoo have different colours for both persons)
How can i change the font proerties at every line. When i used the setfont proerty it change the whole rich text box properties.
How To Change Leading Of A Font For Display In Rich Text
I am trying to reduce the leading in a font that is used in a rich text box.
The richtextbox1.SelCharOffset set to -1, -23 does not do the check when the line wraps. The idea is, given at least 2 lines,:
I would like to get the Line2 characters as close to the Line1 characters (or even overlap them) in a rich text box.
Can anyone offer an example piece of code?
Thanks for the help,
Applying Font Properties Between Two Rich Text Boxes
i am creating a messenger setup. i was told that if i just apply the text from one text box with bold, italic, underline, or strikthru that it would transfer to the next box. but it does not. how do i transfer the bold properties to another text box.
Background Image In My Textbox Or Rich Textbox
i would like to place a fixed background image in my textbox or rich textbox so it will act like a watermark. is that possible? please help.
i tried to use an rtf file template with image on it but everytime the rich textbox is updated the image is removed from view. i would like to remain on its position.
thank you very much. :P
Add Colored Text To Textbox Or Rich Textbox
Is there is script to make it add in a textbox the same text that is in the same text box plus some other colored text. eg
RichTextBox1.Text = RichTextBox1.Text + textFormated(&Hff,"lol")
RichTextBox1.Text = RichTextBox1.Text + textFormated(&Hff0000," test")
Rich Text Box, Color On The Fly.
I read the rich text box tutorial in the Tutor's Corner and it was pretty good. Only left one question. How would you implement on the fly coloring?
Basically I have a normal text box with the code in it, and a preview box with the colored/formatted text, but I'm not sure how to make it trigger the different formatting and then turn it off when a different formaat is choosen.
Hopefully you understand where I'm going with that.
Rich Text Box Color
hi again , i have finished my text editor and am making it so there is a timer that calles a peice of code from a module every 1millisecond. the code will search the document for text like dim etc and will change their colour to blue. i am only testing this out with dim at the moment to see if i will be capable of doing it all. my problem is, i firstly use this peice of code
Dim im As Integer
im = InStr(Form1.rtb1.Text, "dim")
If im > 0 Then
'how would i do this?
the thing is, to change the colour, would i have to use sel start and sel lenght to highlight it and then change its colour by using form1.rtb1.selcolor = vbblue or is there another way to do it without highlighting the text first?
Color In Rich Text Box?
Ok so I am making an IRC program. First I need to figure out how I can turn you username a different color from their username. And I need to know how I can change the actual text color of their message.
Color In Rich Text Box
How do you change the color of the text in a Richtext box mid-code?
txtRTB.SelText="blahdfhasdf" &(insert text color changing code) & vbCrLf & "fsadf"
Thanks in advance
Is it possible to change the font color for the text of a particular cell in a grid???