|
-
Sep 27th, 2000, 07:52 PM
#1
ok , you know how in MS Word, if you have certain text lets say bolded, if you go back and put the cursor within the the bolded text, the BOLD toolbar button becomes pressed to show that the text is bolded, how'd they do that??
-
Sep 27th, 2000, 08:01 PM
#2
A RichTextBox must be used.
And use these:
Code:
Private Sub Command1_Click()
'Bold
If RichTextBox1.Text <> "" Then
RichTextBox1.SelBold = Not RichTextBox1.SelBold
End If
End Sub
Private Sub Command2_Click()
'Italic
If RichTextBox1.Text <> "" Then
RichTextBox1.SelItalic = Not RichTextBox1.SelItalic
End If
End Sub
Private Sub Command3_Click()
'Underline
If RichTextBox1.Text <> "" Then
RichTextBox1.SelUnderline = Not RichTextBox1.SelUnderline
End If
End Sub
Private Sub Command4_Click()
'Strike thru
If RichTextBox1.Text <> "" Then
RichTextBox1.SelStrikeThru = Not RichTextBox1.SelStrikeThru
End If
End Sub
-
Sep 27th, 2000, 08:14 PM
#3
no, what i mean is, lets say this:
I've got a richtextbox and i type a little text in there. OK, so now I want to make two or three characters of the text bold. I've got a toolbar button with the code::
If (richtextbox1.sellength <> 0) then
richtextbox1.selbold = true
end if
and the button style is tbrChecked, Ok, so then i go and type some more text, but the BOLD button is still pressed.
So my question is how do I get the button to become unpressed and SelBold to be turned off when I type in more text, and when I put the I-bar cursor back where the text is bolded have SelBold turned back on and the button become pressed again
-
Sep 28th, 2000, 06:20 AM
#4
Try this:
Code:
If (richtextbox1.sellength <> 0) then
richtextbox1.selbold = Not RichTextBox1.SelBold
tbrChecked.Checked = Not tbrChecked.Checked
end if
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
|