|
-
Nov 11th, 2003, 03:29 PM
#1
Thread Starter
Supreme User
Menu & Text question [RESOLVED!]
Ok, like in a text editor you can select bold etc from the menu. Thats ok, i can do that - im using RTF here is my code:
VB Code:
Private Sub mnuFormatBold_Click()
On Error Resume Next
'Bolden text
mnuFormatBold.Checked = Not mnuFormatBold.Checked
txtMain.SelBold = mnuFormatBold.Checked
txtMain.SelStart = Len(txtMain.Text)
End Sub
Anyway i want to be able to click on a piece of text and determine if the selected text is say bold or not. So if the highlighted text is bold, the menu is checked, otherwise it isnt. This is so the user can view the selected text and see what has been formatted from the menu. If you know what i mean. I tried something like;
If txtMain.Sel = (i tried adding true, but obviously it needs text).
So any ideas are highly appreciated.
THANKS!
Last edited by Madboy; Nov 13th, 2003 at 03:00 PM.
-
Nov 11th, 2003, 05:03 PM
#2
Thread Starter
Supreme User
-
Nov 12th, 2003, 01:33 AM
#3
Frenzied Member
VB Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
mnuBold.Checked = RichTextBox1.SelBold
End Sub
-
Nov 13th, 2003, 02:59 PM
#4
Thread Starter
Supreme User
Thanks, even though the code goes in the Text box routine, like so:
VB Code:
Private Sub txtMain_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
mnuFormatBold.Checked = txtMain.SelBold
End Sub
Thanks anyway for the code
-
Nov 13th, 2003, 03:30 PM
#5
Frenzied Member
works either way, probly better to have it in form_mousemove tho
-
Nov 13th, 2003, 03:39 PM
#6
Thread Starter
Supreme User
Yeah, but that would only trigger the code if the mouse is moved over the form. Which is bad considering the textbox covers all the form. Apart from the caption bar!
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
|