Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




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
Hi,

how can I change the font color of a rich textbox? I've tried looking for "forecolor" option but there's none...

Thanks...

Changing The Font Color Of A Rich Textbox
Hi,

how can I change the font color of a rich textbox? I've tried looking for "forecolor" option but there's none...

Thanks...

Changing The Font Color Of A Rich Textbox
Hi,

how can I change the font color of a rich textbox? I've tried looking for "forecolor" option but there's none...

Thanks...




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 The Color Of The Font In A Rich Text Box
Is it possible to change the font color of a richtextbox?

thanks,
Doc

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.
venu

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 : kaingchantha@iic.edu.kh;kaingchantha@hotmail.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:
Code:
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:
    Str(tmp)=16
    Str(frmMainForm.Font.Size)=15.75
    Str(txtMainScreen.Font.Size)=15.75
'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 - Changing Font For A Specific Line Only
Hi! I have a long text on a Rich text box control, and i want to change the font for certain lines only. How can i do this without changing the entire textbox's font?

Thank you very much!

Rich Textbox Color
Hello,
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:


VB 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?

Rich Textbox Fore Color
how do i set the fore color or text color for a rich text box

TextBox Color And Font
Hi All
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?

Thanks

Rich Textbox Color Change? (Resolved)
How do I change the text color of a Rich Textbox?

TIA

Setting Font Color In Textbox
what property would i use to set the font color in a textbox on a form? thanks!

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

However,
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?

Change Font Color For Disabled Textbox, How?
when I change the property of enable(=false), the font color of that textbox is change to silver, Is it possible that I can change the disabled font color to black?

Changing Disable Textbox Font Color
Hi,

I need help here, is it possible to change a disable textbox font color?.

Thanks

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...


Code:
Option Explicit

Private Sub FontBox_Change()

Dim FontName As String
FontName = FontBox

Inpt.FontName = FontName

End Sub

Private Sub Form_Load()

FontBox.AddItem "Times New Roman"

End Sub

Private Sub mnuExit_Click()

Unload Me

End Sub

Private Sub mnuNew_Click()

Inpt.Text = ""

End Sub

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?
Guru,

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?

Thanks,
Tabbey



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.

Please help?

Thanks

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.

Parse &lt;font .... &lt;/font&gt; Tag And View The Progress Into A Rich Text Box (Solved)
Hello, does anyone know how to parse the <font ... > </font> tag from an html file and view the output into a Rich Text Box? Using VB Code and even RTF code if you want.

For example: i have this tag

<font name="Arial" size="3" color="#FF0000>Hello</font>

Hello

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

In VB App: Set Windows Select Color And Selected Font Color?
Hello,

Is it possible to set the Windows select color and the color of the selected font from within a VB application and then return to the original properties when application is closed?

Servo

Msg Box; How Do I Change The Font Color And Background Color
I want a message box to pop up whenever someone opens a file. Further, I want to change the fill colors from grey and blue to something else, and I want to change the color of the fonts. Any suggestions?

Changing Back Color Or Font Color Of DTP
hi folks,
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.

VB Code:
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.

Font Size And Font Color
how do i let the user pick what font and what what color of a font with the common dialog?

Rich Text Boxes (font)
Hi all

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


VB Code:
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?

Rich Text Box Font Size...
How can I change it if I'm using a ShowFont dialog?

Thanks!

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:

Code:
    On Error Resume Next
    If ActiveForm Is Nothing Then Exit Sub

    With dlgCommonDialog
        .DialogTitle = "Font"
        .CancelError = True
        .Flags = cdlPDReturnDC + cdlPDNoPageNums
        If ActiveForm.rtfText.SelLength = 0 Then
            .Flags = .Flags + cdlPDAllPages
        Else
            .Flags = .Flags + cdlPDSelection
        End If
        .ShowFont
        If Err <> MSComDlg.cdlCancel Then
            ActiveForm.rtfText.SelFontName
        End If
    End With


An help would be appreciated

 

Rich Text Box Font Change.
How do you change the font of rich text box to only selectd text or text not typed yet? thx

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
Hello,

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,:

Line1
Line2

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,
Scott

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.

thancks

Change The Font Of A Rich Text Control Of Known Handle ?
Guys!
Seems nobody knew the answer to my previous question, here is the question is a simpler mode:

How can I change the font of a rich text control in an another application if I had its handle ?

Anobody please ???

Background Image In My Textbox Or Rich Textbox
I need to place a background image in a textbox or rich textbox as well. Is there no API or GDI(?) solution?

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

Before:

Code:
text

RichTextBox1.Text = RichTextBox1.Text + textFormated(&Hff,"lol")
After:

Code:
textlol

RichTextBox1.Text = RichTextBox1.Text + textFormated(&Hff0000," test")
After:

Code:
textlol test

Locking The Font/size/style In Rich Text Boxes
Is there an easy way to force a single font on a rich text box so if someone pastes somehting in there it converts it back to the set font/size/style?

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
Code:
Dim im As Integer
Sub color()
im = InStr(Form1.rtb1.Text, "dim")
If im > 0 Then
'how would i do this?
End If
End Sub
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?


ex:

txtRTB.SelText="blahdfhasdf" &(insert text color changing code) & vbCrLf & "fsadf"


Thanks in advance

Font Color
Is it possible to change the font color for the text of a particular cell in a grid???

dz

Copyright © 2005-08 www.BigResource.com, All rights reserved