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




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?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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

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?

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 <font .... </font> 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 Apply Custom Font To Text Box Or Label Or Rich Text Box
I am developing an application where i had to set custom font to a text box or a label or a rich text box. Can anyone suggest me the way i can do it.

Regards,
balu

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.

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 Text Boxes
Ok, I'm having a bit of a problem with these things. Say I have a text box with the following data:
"Welcome" which is in blue for example.
I want to add a new line now which says 'To Neopian', how can I add that making ONLY the new information green keeping 'Welcome' blue?

Rich Text Boxes
hi all, im new to VB and dont know much about it, everything i do know ive worked out myself as my help file wont work.

i need to know whether there is a code to skip a line in a rich text box..

for example:
if i had this:

form1.richtextbox1.text = "line1 line2"
i would get the text line1 line2

but what i want to do is have the text read:
line1
line2


thanks in advance

damien_gothic

PS: i suck at VB

Rich Text Boxes
How do you add text to an embedded object in code? Currently what I'm doing is loading an excel file into a Rich Text Box control as an OLE and would like to know how to add text to this OLE in code. This is the code I'm using to load the file:

*******************************************
Private Sub Form_Load()
* * * rtbTest.OLEObjects.Add , , "Z:Excel quote and salesSales Order Form.xlt"
End Sub
*******************************************

Or would it be simpler to to save the text directly into the excel file from within VB. And if so, how is this done?

Thanks a lot,

TomGuy

Rich Text Boxes
hi guys...

could anyone point me in the direction of any tutorials/examples of how to use a rich text box...ive been trying to find some, but to no avail! =(

i would like to be able to load an RTF which has various bold headings for the summary sheet that i want to display...and during runtime, the appropriate variables should be displayed in appropriate positions under/next to the headings...

thanks alot

Rich Text Boxes
Hey all, I have been programming in VB for about 1 1/2 months now and I have got a question. I have heard a lot of you Novices to Experts talk about Rich Text Boxes. What are they and what is the difference between them and normal text boxes?

Help With Rich Text Boxes!!!!!!
Ok, i have a problem. I changed the text box in my program from a standard text box to a rich text box. The way the program is set up, when the form loads it automatically opens a text document and loads it into the text box. Now that i have changed it to a rich text box, the program is crashing, saying input past end of file. Here's the code for when the form loads:


VB Code:
Dim lngCharacters As Long        'Open log file for input so it can be loaded into the text    'field.    Open "G:COMMONAOPSA-Ops Incidents ReportLOGSIncident_Report.rtf" For Input As #1        txtLogComments.TextRTF = Input(LOF(1), 1)        lngCharacters = LOF(1) / 8        lblCharacters.Caption = lngCharacters & " Words Loaded"    Close #1


Can anyone help me fix this? It worked just fine when it was a standard text box, but the file gets larger everyday since mostly everyone in my department uses the program. Also, since i changed it to a rich text box, will it affect how it saves too? Here's the code for saving to the file:


VB Code:
'Open text file so it can be written to        Open "G:COMMONAOPSA-Ops Incidents ReportLOGSIncident_Report.rtf" For Append As #1    'A-Ops Incidents ReportLOGSIncident Report.txt            Print #1, strDateTimeStamp            Print #1, "Server: " & strServer            Print #1, "Issues: " & strIssue & ", " & strAlert            Print #1, "Response: " & strResponse            Print #1, "User: " & strName            Print #1, "Comments: " & strComments            Print #1,            Print #1, "----------------------------------------------------------------------"            Print #1,        Close #1        'Close text file  


Thanks.

Rich Text Boxes
VB Code:
Private Sub cmdAddText_Click()rtfTesting.Text = txtToAdd & vbCrLf & rtfTesting.TextrtfTesting.SelStart = 0rtfTesting.SelLength = Len(txtToAdd)rtfTesting.SelColor = vbRedEnd Sub

when i click the command button, the top line of my textbox changes which it what i want but then ALL of the lines underneath it are reverted to the last colour of the top line? i've looked at the .TextRTF in a normal textbox and can see why this happens but i havent got a clue how to get round it anyone?
- cheers

Rich Text Boxes!
i have this code...


Code:
Private Sub code_KeyPress(KeyAscii As Integer)

If KeyAscii = "13" Then
code.Text = code.Text & "<br>"
End If

End Sub

but when i click the button it (it being the cursor from which letters magically appear) goes back to the begginning of the richtextbox, whereas i want it to add <br> onto the end of what is in the box, and then i can carry on typing, on the end of the text!!!!

Rich Text Boxes
I am really confused and i didnt know where 2 post this question, so i hope i can get some answers here.

Im writing a word proccessor in VB 6 and i want 2 implement tables and other stuff like Microsoft word's junk, and i just cant find a way to stick them in my RICH textbox.

If any1 wants 2 help (4 credits in the about section in return) plz plz plz drop me a line!

Thanks,
The Red One

Rich Text Boxes!!!!!
plz help ppl

i have a richtextbox on a form
the form has a black background
the text box has a black background
i have a freeSize.ocx resize control to auto-resize the form and its controls etc.

i add the text to the text box at runtime, using SelText and SelColor to format it

if i resize the form, the text all becomes black - i want it to keep all its colours - how can i solve this?

ty 4 ur help!

Rich Text Boxes....
Open foldername & "scenario.chk" For output As #1
Print #1, txtfinal
Close #1

assume txtfinal is a rich text box

how can I output this, with JUST the text(no formatting stuff)

i NEED to get it in a file, but without any extra stuff, like if you output a normal string/textbox

thanks in advance(dont worry, that doesn't mean I wont' thank you after :-P)

Rich Text Boxes
Hello Everyone,

I am trying to use a Rich TextBox in a DLL that creates a text file of Emails in my Database. The problem that I am having is that when i try to set the text property equal to the to body of my email message(which i am getting from a recordset) I get an error message saying "Set Not Permitted".

Can anybody help me get past this, Please Help!

Rich Text Boxes
Can you put page breaks in rich text boxes. If not how can you handle a page break in a text editor.
Thanks

Rich Text Boxes
I have 2 rich text boxes one named richChat (where chat messages are displayed) and one called richSend (the message you are sending)

I am currently just testing it and copying the text from Send to Chat and having problems with formatting.


Code:

richChat.Text = richChat.Text + "Test User: " & richSend.Text



This works however the formatting I put on in richSend is no longer formatted in richChat

I'm gonna give you an example so you can write the code for the example I have given

I want Test User: to display in blue in richChat and lets say i formatted the richSend to be red.

If you dont understand what I mean let me know coz I'm not sure if i have explained very well. If you do thanks and hope to hear how to do this shortly

Rich Text Boxes
how do I change the fontsize of a rich text box? or make the font of it bold, italic, underline, and/or strikethru?

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

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

Rich Text Boxes And Pictures
I've seen a few ways of adding pictures to Rich Text Boxes, and I would like to know something.... Is there any way to keep them from being resizable/editable?

Pictures In Rich Text Boxes
im trying to get pictures in rich text boxes, can ne1 help

thanks

SendMessage API With Rich Text Boxes
-edit
The program is not one in the IDE, i am useing the FindWindow and FindWindowEx to get to the textbox
-/edit
I am trying to get the text from an application, all formated like it is shown in the window, and format it my way, and then send it back.
Ive been messing around with the sendmessage, but all i can retrieve and format is just plain text, with no formating.
Is there a constant or something to use for this?
right now i am useing WM_GETTEXT and WM_SETTEXT, but as i said, i need the formating of the text. I tried the WM_COPY, but i couldnt get that to work.
Any help appriciated.
thanks

Arrgghh - Where Have My Rich Text Boxes Gone!
Wotcha, folks.

I've just loaded our office database into VB6 for a minor adjustment and ALL the rich text boxes have turned into picture boxes !!!

What went wrong ??

All my backups load in the same way - RTBs have turned into Picture Boxes, so the problem must be with the VB6 environment!

What can I do - re-install VB6?

Anyone know how or why this has happened?

Need help.

Jack.

Scrolling 2 Rich Text Boxes At Once
Hello,

I was wondering if anyone could tell me how to make it so that whe one rich text box is scrolled by the user, the one next to it scrolls the same amount?

What I'm trying to do is add line numbers to my app. It works right now, except when the main window is scrolled the numbers in a rich text box next to it don't move.

Thanks,
Justin Sampson

Quicki With Rich Text Boxes
how do you append text to the bottom of a rich text box regardless of where the cursor is.

Last Question About Rich Text Boxes
Well, after about 30 minutes more of debate I figured out my first questions but now I can't get the other part I need and it's pissing me off. Anyway, here's the deal: I have a rich textbox called "txtHistory". I want to know how to set different font colors. I know it starts like this:

frmIM.txtHistory.SelColor =

But what kind of code do I use to set the color? Can I use HTML (ie: #000000) or do I have to use something else. If you could just give me some examples for colors like black, red, yellow, maroon, light blue, or anything it would be greatly appreciated. I just need to see how to do it. Thanks,

-zer0 flaw

Rich Text Boxes And SpreadSheets
Background:
I am trying to create a "template" document simular to a database report. It has some text at the top and would like to place a spread sheet at the bottum. All this is automatic setup by a preset options.

All I really need to know is how to place a OLE into a Rich text Box at runtime with out the user needing to do it.

Also on another note does anyone have any code for a good column generator for a rich text box to handle a dynamic number of colums and rows ie

H1 H2 H3 H4 ....
xxxx xxxx xxxx xxx
xxx xxxxx xxx xxxx
xxx xxxx xxxx xxxx
... ... ... ...

Saving Txt In Rich Text Boxes
How do you save plain text in a rich text box?

Rich Text Boxes &amp; Files
I need to take apart the text in a richtextbox line by line to put into a file because i need to return line by line.

doing this:

write #1, richtextbox.text

will make a single "entry" to the file... how can i take apart the textbox line by line?

00h, Strings, And Rich Text Boxes
I’m working on this program in vb6 where I am loading a DLL into a rich text box and replacing certain strings inside the DLL with 00h. All the functions work fine and everything, but when I try to replace with a string of “chr(0)” it puts absolutely nothing, and when I try a string of a bunch of “vbNull”s, I get 01h. "&H0" doesnt seem to work either. How can I do this?



(Here’s some sample code if you need it)



Call findandreplace("whatevergoeshere", rtb1, String(16, Chr(0)))

Call findandreplace("blahblah", rtb1, String(8, &H0))



Sub findandreplace(needle As String, haystack As RichTextBox, replacement As String)

' Set the options

goptions = 0

haystack.SelStart = 0

haystack.SelLength = 0

' Set the counter to 0

gCount = 0

Do

If haystack.Find(needle, haystack.SelStart + haystack.SelLength, , goptions) = -1 Then

' No more matches

If gCount = 0 Then

' First time round, no matches found

MsgBox "Unable to find '" & needle & "' in specified range"

Else

' Matches found

MsgBox "The specified region has been searched. " & gCount & _

" replacements have been made"

End If

Exit Do

Else

' Increment replace count

gCount = gCount + 1

' Replace the selected text with the replace text

haystack.SelText = replacement

End If

Loop

End Sub

Emoticons(images) Into Rich Text Boxes..
hello, i was wondering if u could help me(tell me) how u can make it so when u click on a picture box that has a picture in it, then the picture will appear in a rich text box, kinda like emoticons for a messenger program..

thx in advanced

Animated GIFs In Rich Text Boxes
Before you hit the reply button and say: Search the forums / For the last time click this link / Why bother posting this?, then please read:

I have searched and searched. All I am looking for is a simple to use code, that I can paste into my code. I want to be able to display animated gifs in a rich text box. Is there a simple way to do this?

If you really believe that I haven't searched hard enough, then I'll delete this message

-Grayda

Small Problem With Rich Text Boxes
hey i have had projects in the past that use rich text boxes but now i cant find a way to actually put one on my project

on the left there is no option for it and i cant remember what i had to do in the components menu to put an option there for it or something like that

thanking you in advance

The WebBrowser Control And Rich Text Boxes, Oh My!
I am trying to insert text into a richtext edit control (similar to this one on the new thread page) located on a web page via the WebBrowser control and DOM, and finding myself unable to do so successfully. The rich text box is added via a JavaScript (for detecting whether or not JS is enabled; if it isn't, then it reverts back to a textarea tag) and I am unable to put text in it.

I have tried assigning text as I do to other text boxes, such as input type=text and textarea, but am having no luck.

Is there anyway for me to insert data into this without getting the handle and using SendKeys?

Thanks in advance,

Brandon

Printing Multiple Rich Text Boxes
How would you print the content of mulitple rich text boxes to the printer? I haven't got a clue how to do this.

Split File Into 2 Rich Text Boxes
Hi,
i know you can use a Split() function to split up files.

But how would i use it to put half a file into 1 rich text box and the other half into another rich text box.

Thanks for any help.
-Dave

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