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




Rtb Bold Text Not Using Selbold


I want to use a rtb, and only make some bits of text bold.

I downloaded the RTF document here:
http://www.xtremevbtalk.com/atta...tachmentid=205

which is VERY useful! Using the "{ text here}" syntax I should be able to achieve what I want, but I need some more help, as I can't find any on google, or in the forum!

I'm using this:

Code:
WelcomeText = "{{ Welcome to blah blah!}" & _
"{line}{line}line 2 here which should be non-bold" & _
"{line}{line}{ and this is bold again.}" & _
"{line}{line}etc}"

this is all I've figured out from the document I downloaded. But I think I need to use headers, but I'm really not sure!

Using the code above other text which is similar (and changes depending on different buttons clicked) becomes ALL bold, instead of just the parts I need.

Being new to this rtb syntax I'm struggling! Anyone know anything about this?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Rich Text Box Selbold Problem
Hi,
My program searches string in RTB and make it bold.

VB:
--------------------------------------------------------------------------------
text1.find("abcd")
text1.selbold=true
text1.selunderline=true
--------------------------------------------------------------------------------



what happen when I search another string old string bold become false and new string bold become true automatically. I want to keep all selected string bold and underline.
how can we do that?

hope someone answer me

Thanks
syed

Rich Text Control SelBold Settings
Hi
Im having trouble setting the bold and 'not' bold properties in a rich text
control.
All the text in the control is entered through code and the bold property is
different for different sections.
I am using the selstart and sellength to set the selection then either
selbold=true or false to set the bold.
I have debug.printed the selections and true false to see if it is getting
the correct selections and true or false.. but it is no setting the nonbold
text to normal.. everything is appearing the same.

Here is some sample code as procedure:
ps I found i had to keep th start point as a static variable because
whenever text was added through code it would reset SelStart to 0

---------------------------------------------------------------------------
Private Sub subBold(varState As Boolean)

Static varInsertPoint

With frmMain.rtfInput
.SelStart = varInsertPoint
.SelLength = Len(.Text) - varInsertPoint
.SelBold = varState
Debug.Print varState & .SelText
varInsertPoint = Len(.Text)
End With

End Sub
----------------------------------------------------------------------------
--

Any help is very much appreciated :)

Bold/non-bold Text On CommandButton?
Is there any way to make PART of a CommandButton's Caption bold, and part of it not bold (normal)?

For example, if I wanted the first word to be bold and subsequent words to be NOT bold...how would one do that?

How To Make Bold Text In One Textbox Bold In Another Textbox
I am writing a somewhat basic chat application, I was on the verge of releasing it when I spotted a bug. When I typed with bold text inside Text1, it only appeared normal inside Text2. Is there any way to have Text2 display the text formatting as well? I would also like to do this with the text colors.

Use A Text Box Or Rich Text Box To Make Text Bold?
I want to make some text in a text box bold, other text red, and some other text blue. Does anyone know if I can do this with a textbox, or do I need to use the Rich Text box?

Thanks...

Rich Text Box Bold Text Problem
Hi,
My program searches string in RTB and make it bold.

Code:
text1.find("abcd")
text1.selbold=true
text1.selunderline=true

what happen when I search another string old string bold become false and new string bold become true automatically. I want to keep all selected string bold and underline.
how can we do that?

hope someone answer me

Thanks
syed

How Can I Save A Text File With Bold Text In It
Hy... i have to make a report and write something like this:

blah blah=value

and then open it in winword.

The opening part i know, but how can i save the file with this format?
I don't have a richbox control in my form and if it is possible i don't want to use one.
Thanks in advance.

.SELBOLD
I'm getting a headache!

I'm trying to write a simple little message program using a richtext box and I add a toolbar with three buttons. The first one is a BOLD button but thi sis the problem I have..

If you click on the bold button on the tool bar, the button is in an unpressed state and stays like that uless you code to change it to pressed.. however if you click it again, the control unpresses itself so I'm getting a problem that I can't tell if the user is pressing or unpressing the button.. does anyone have any clue as to why the control acts like this ? I'm using vb6 with the sp3 . Let me know thanks.

Text In Bold With Vba
I write a text to a word file with vba. But how can I write the text to the word file in bold

Help Making Bold Text In RTB
Hi there!

I have a small problem making bold text in a rich text box. I am looping through a string array and making the matching words bold, however if it finds a partial word then it will 'bold' the wrong thing. Here is the partially working code:


Code:
For i = 0 To UBound(rWord()) 'string array
If InStr(rtb1.Text, rWord(i)) Then
b = InStr(rtb1.Text, rWord(i))
rtb1.SelStart = b - 1
rtb1.SelLength = Len(rWord(i))
rtb1.SelBold = True
End If
Next i

So if the word "beer" and the word "bee" is in my text and the word "bee" is in my array, it will end up like this:

"Here is the word beer and the word bee."

Is there a way to come up with a more exact match? I've been looking at this and scratching my head.

Thanks for looking


Max.

Rich Text Box - Bold
Hi

If I have a string called strName and strText, how could I make the rich text box rtbText contain

strName (in bold) & ": "

and

" " & strText

So basically the prob is the bold

Cheers!
Bratch

Bold Text In Msgbox
Hi to all,
How can i make text apperaring in msgbox "bold" in vb6

API - Bold Menu Text
Can anyone help me with how to use an API call to make the text in a menu BOLD?

RTB - Make Whole Text Non-bold At Once
Hey,

I was wondering if it's possible to make the entire text in an RTB 'non-bold' (SelBold = False) all at once, without selecting the entire text and then setting SelBold to false...

I'm trying to create a 'bracket-shower' which in short:
- checks if the cursor is infront of a { bracket
- If yes - make that bracket bold
- If no, make the entire text non-bold (or in other words, 'delete' the boldness of any possible bold { brackets)

At the moment I'm using the following code:

vb Code:
Private Sub rtb_SelChange()Dim lSelStart As LonglSelStart = .SelStart     'This will make the selected bracket bold     With rtb                .SelStart = 0        .SelLength = Len(.Text)        .SelBold = False        .SelLength = 0        .SelStart = lSelStart               If Mid$(.Text, lSelStart + 1, 1) = "{" Then            'Cursor in front of opening bracket            'Make bold            .SelStart = lSelStart            .SelLength = 1            .SelBold = True            .SelLength = 0        End If            End With End Sub


But obviously there are problems with the first part (making the text non-bold). Longer selections don't work (since the sellength is set to 0 directly after selecting...) and things like that... Also, sometimes, the selecting procedure can be seen by the user (you can see the text getting selected )

So is there any way of doing this?

Bold Text In MSFlexGrid
Hello All,

I have an MSFlexGrid with several rows. What I cannot seem to get is for the first row, Row 0, to be bold and the other rows to be normal. I either get all or nothing bolded. Code tried:-

MSFlexGrid1.row = 0
MSFlexGrid1.Font.Bold = True

MSFlexGrid1.row = 1
MSFlexGrid1.Font.Bold = False

etc.

Tarablue

Bold Text In Treeview
hey, does anyone know how to change the treeview text into BOLD, which is considered as Default value in my case

thank a lot for any suggestion1

Bold In Rich Text Box
i have a chat client and i want to have the username of the message highlighted in bold which i have done with the following


VB Code:
temp = InStr(Right(data, Len(data) - 4), " ")            RichChat.Text = RichChat.Text & vbNewLine & Right(data, Len(data) - 4)            RichChat.SelStart = Len(RichChat.Text) - Len(data) + Len(vbNewLine)            RichChat.SelLength = temp            RichChat.SelBold = True


except after its ran again. it unbolds the first bold its allready done then rebolds the newest row. how do i keep my old bold's as well as my new bold?

Bold Text In Menu ???
Hi everybody !

In the pictures below, I want to set in bold the text in the 2 boxes ?

I searched on this forum and I found only that I can use PopupMenu Method.

PopupMenu does'nt work, maybe it's not the good method or I dont know how to use it ???



Thanks in advance !

To Make Text Bold
is there any way to display some text in text box as bold

Making Text Bold
Hey, I wrote a script which makes the font in a text box bold one a button is clicked


VB Code:
ElseIf Button.Key = "Bold" ThentxtMain.FontBold = True


Theres a bit of it for you, but I am not sure how to make it unbold, I tried using variables to do it but it didnt work, this is what I did to try and make it unbolden when pressed again


VB Code:
ElseIf (Button.Key = "Bold") & (ModBold = False) ThenModBold = TrueElseIf (Button.Key = "Bold") & (ModBold = True) ThenModBold = False


if ModBold was true then the text would be bold otherwise it wouldnt be, any ideas?

Bold Text In A Message Box.
How can I make the text in a message box bold?

Bold Text In Toolbar
In my select case coding for my toolbar, how do i write the code to make the selected code in the rtb bold?
Aslo italic and underline.

Thanks

Bold Text Using The RTF Codes??
Does anyone know the code to bold text using the RTF code?

Bold Certain Text In RichTextBox
Ok, I have a chat program and I want to bold the username.

I'm guessing I won't be able to send bold text, so here is the recieve sub.


VB Code:
Private Sub sockConn_Read(Index As Integer, DataLength As Integer, IsUrgent As Integer)    Dim strBuffer As String    Dim cchBuffer As Integer    Dim nPos As Integer, strEol As String       Dim scrolldown As String    cchBuffer = sockConn(Index).Read(strBuffer, 1024)    If cchBuffer < 1 Then Exit Sub    g_strBuffer(Index) = g_strBuffer(Index) + strBuffer        strEol = Chr$(13) + Chr$(10)    nPos = InStr(g_strBuffer(Index), strEol)     If nPos > 0 Then        textOutput.SelStart = 65535        textOutput.SelLength = 0       a = Len(textOutput.Text)       textOutput.SelLength = a        textOutput.SelText = Left$(g_strBuffer(Index), nPos + 1)        g_strBuffer(Index) = Right$(g_strBuffer(Index), Len(g_strBuffer(Index)) - (nPos + 1))    End If End Sub



I don't know exactly whats going on the above code, but I think the last 3 lines have to do with displaying the text.

Text thats sent will be like,
Username: Message

I need to bold "Username:"

Of course "Username" will vary... although I think that max is like 10-15 characeters.

Can anyone give me some code that could do this??

Thanks a Billion

Msgbox Text In Bold
Hi

Is there any way to display the text of message box in Bold.

any API calls, tricks,ideas.

Thanks.

Menu - Bold Text
hy, how can i create a Bold text in my menu .. like popup!!``

thx Longbow

Message Box Text In Bold
Hi,
   
Msgbox "You are about to delete 1 record(s)" & vbcrlf & " Are you sure? "

In the above statement, I want the text "You are about to delete 1 record(s)" alone in bold.

How to do it?

Iswaria.

Message Box Text Should Appear Bold
can anyone tell me how to make messagebox text as bold

or, part of text in messagebox should be bold

ex,
 
 if the text is hello how are you

 i want how to be bold

Bold Text In Menu
How can I make a menu caption bold but only the specified one?



Edited by - TankMaster on 3/11/2004 7:08:13 PM

Message Box Text In Bold Using Api
 Hi,
   
Msgbox "You are about to delete 1 record(s)" & vbcrlf & " Are you sure? "

In the above statement, I want the text "You are about to delete 1 record(s)" alone in bold using API and not through custom Messagebox using forms.

How to do it?

Iswaria.

Bold And Coloured Text
Hi, this is a simple question but i cant find the answer anywhere

i want to make a string a different colour. I have 2 text string to place in a text box. I need them to be 2 different colours. Therefore i cant set the text box foreground to a colour

can someone help me please

thanks

Turning Text Bold PLEASE HELP!!
i need to know how to...
when you have a text box and while the programs running you can type in the text box. then when you check a box the program turns the text that was typed into bold. thats all i need to know. how to make that text bold when you check on a box. i can figure out the italics and underline from that right? and how to turn it off when the buttons unchecked. that should be easy. but i cant figure out how to turn the text bold (or italic or underlined). please help me!!

.SelBold .SelColor
Hey

Im doing a program and have split some text either side of the ":"


Code:
With txtMain
.SelColor=vbBlue
.SelBold = True
.SelStart = Len(.Text)
.SelText = Split(TotalConvo, ":")(0) & ":"
.SelColor=vbBlack
.SelBold=False
.SelStart= Len(.Text)
.SelText = Split(TotalConvo, ":")(1) & vbCrLf

When it says .SelColor = vbBlack, it all stays bold andi n blue. I was hoping I can change the color and bold properties after the ":"

Ian

RtbPad.SelBold = Not RtbPad.SelBold
Hi, all !

I tried posting this on codeguru, but got no joy. I'll try rephrasing it ...

A hypothetical text editor, using a RichTextBox control has a menu/toolbar [whatever] with a _bold_ item that can be toggled on/off, just like in MS Word/WordPad.

In VB6, you would have stuck the code in my subject behind it, but this does not work any more, as MS has made the SelectionFont.Bold property read-only and introduced Font objects.

Dunno if this helps, but I was working along the following lines ...


Code:
Dim x As Font = rtbPad.SelectionFont
Dim y As FontStyle = x.Italic Or x.Strikeout Or x.Underline
If x.Bold Then
rtbPad.SelectionFont = New Font(x, y)
Else
rtbPad.SelectionFont = New Font(x, y Or FontStyle.Bold)
End If

... although this doesn't work yet ...

Anyone feel like giving me a hand. This must be a pretty common issue, I just haven't got my head round VB .NET yet.

Just in case, I do not want to use FontStyle.Regular, as this would remove other formatting. Nor do I wish to use a FontDialog. I am just looking to get my toggle back ...

thanks

jON

.selbold The First Line?!?!
I'm using a rtb and I want the first line to always be bold is there a way I can set a line to be bold?!?!

Problem With .selbold
I thought all you had to do was set selbold to true and it would make anything bold in the rich textbox until you set it to false?!!? Am I making a mistake?? I put

rtbreport.selbold = true
'entered all my stuff I wanted bold then
rtbreport.selbold = false

it doesn't make it bold am I missing something ?!?!

RichTextBox And SelBold
I am trying to bold the first line in a Rich Text box, the first time I run the code it works ok, but the second time it bolds all the text in the textbox.


VB Code:
txtInfo.Text = vbTab & vbTab & "Joystick Core code SRecord" & vbCrLf & vbCrLf & txtInfo.Text      txtInfo.SelStart = 0      txtInfo.SelLength = 28      txtInfo.SelBold = True


I've tried adding this


VB Code:
txtInfo.SelLength = 0      txtInfo.SelBold = False


but it does not make any difference.

Any ideas?

Make Text Bold In Word
hello,
i'm inserting some text into word from visual basic. i use the following code:


Code:
MyWordApp.ActiveDocument.Bookmarks("Equipment").Range.InsertAfter Text:=lstItemsOrdered.List(i)

this works fine. i want to know if there is anyway to make this text bold.

thanks for the help

cheers

Find Text Then Bold It Via VB6 And Word
I'm trying to programmatically make a phrase bold and underlined within a Word document text that I generate from a VB6 app. Ideally I'd like to do this right as the text is added to the document, but I don't think there's a way to do this since the text I insert comes from the database (I do wonder if it can be done when I'm hardcoding text that goes into a Word document from VB6, this can also be useful to me).

At any rate, once text is inserted into Word from the database, I go to a bookmark, then I'm try to find the first instance of a specific phrase after the bookmark and make it bold & underlined. Is there a way to do this? Here's my snippet that didn't work:


Code:
WordDoc.Bookmarks("blah_blah").Select
With WordDoc.Bookmarks("blah_blah").Range.Find
.Text = "blah"
.Replacement.Text = "blah"
With .Replacement.Text
.Bold = True
.Underline = True
End With
End With

Thanks

~Laz

How To Use Bold And Italic Text In A Textbox
i want my textbox to be bold when the user press ctrl+b and italic when ctrl-i like in microsoft word. is there a function for that? and yeah also the highlight function using shift key..

And one more thing.. can the bold italic used in a statement like if mystring is bold then... got my point? thanks a lot..

How To Make Text Bold In Textbox
Hello, everyone.
Please someone help. I want to make selected text in a textbox bold and also want those selected text print bold on the printer. How do I do that? I know how make all the text in the textbox shown bold and print bold, but I am unable to make selected text bold. I know someone knows how.

Thank you for help in advance.

DanVue

How To Bold Text In A Editable WebBrowser?
halo everyone!

Is there anyone who knows how can i do formatting such as Bold, Italic, ..etc
to the text inside the webBrowser?

Is any setting or coding involved? Please specify if any.

Thanks really lot for lending me a hand!!

Making Tooltip Text Bold
how can i make tooltip text bold?

on a different note, I would also like to know how i can make parent entries for treeview bold as well.

Text Box, Vb6, Controling Bold Italic
What I have is a text box that is called txtMsg that I can change and send the changes to a remote mysql data base. This information is then read by a php file and you see the changes on the web site. right now if I want to say change the color of the first two words to red I have to type this into my txtMsg box.

<font color="red"> Hello World</font color>.

What I would like to be able to is have a color selector and highlight the words Hello World and it place the <font color="red"> </font color> on each side of the highlited area.

hope some one has an idea or has done something like this before.
thanks Robert

Bold Text Moves To Saved Txt?
ok guys see if you can figer this one out
i save a file to whatever.doc but its not saveing the formatting to the new file the bold text impaticaler
i use a true text box and i select text and hit a butten to bold the text selected.
this code runs

Code:
Private Sub cmdhighlight_Click()
rtbMdcDisplay.SelBold = True
End Sub
that makes the text bold then i save it to a .doc file


Code:
Private Sub Command1_Click()
On Error GoTo hell
Open Dir1.Path & "" & Text1.Text & ".doc" For Output As #1
Print #1, FrmTxtWindow.RtbFileVeiw.Text
Close #1
valuelabel.Caption = Dir1.Path & "" & Text1.Text & ".doc"
FrmTxtWindow.Enabled = True
frmSaveAs.Hide
Exit Sub
hell:
MsgBox Err.Description, vbCritical, Err.Number
End Sub
but then i open the doc file in word and all the formatting is gone only thing right is each line is on the right line.

so this text
this is a test normal
this is a test bold

comes up in word as
this is a test normal
this is a test bold

i hope you understand what i mean.. please help

thanks in advance

Making Text Bold Or Italic
Hi There,

Is it possible to change the text in a MapiMessage Bold or Italic or change the size?


Code:
MAPIMes.MsgNoteText = "I want this message to be Bold or Italic"


Tnx in advance !!

Combo Box With Bold Text Items
Hello. I have a combo box with many items but I simply want to make one of these items bold. I'm a bit of a novice to VB so nothing to complex please! Its probably only a line anyway...

thanks.

Underline - Italic - Bold Text ?
how can i program a text in code, that it will change from a standard text into a underlined - italic - bold text ?

i know it's a stupid question ... but i'm lost it in my memory


tnx

RichTextBox: How Can You Add A Bold Line Of Text?
Anyone know?
Like if I wanted to add in a textbox 3 lines.. "a", "b", "c".. how can I set "b" to bold?

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