Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text hilighting

Status
Not open for further replies.

mettodog

Vendor
Jul 11, 2000
94
US
how would i set a default font at form load? and, when you hilight text then click on frmmain's toolbar, of course frmmain becomes in focus now, and the hilighted text appears to be not hilighted anymore, but of course when you click on the rtf form, its hilighted again, my question is, how can i make it so that even when the rtf form does not have focus, the text still remains hilighted?
 
I can answer part 1...
Code:
Private Sub Form_Load()
  On Error Resume Next
  
  Form1.Font = Verdana
  Form1.FontBold = True
  
  Dim index As Control
  For Each index In Form1
    index.FontBold = Form1.FontBold
    index.Font = Form1.Font
  Next index
End Sub

Don't know about the second part.

Later,
Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
I have just tested two scenarios:

1. If you have ordinary forms in an SDI project, then what you say is correct; highlight text on one form and then clicking on another form removes the highlighting from the first form, and then clicking back on the first form shows the highlighting again.

2. In an MDI project, the above does not happen, when the two forms in question are the MDIForm and one MDI Child (it does happen if the two forms in question are the MDI Child forms).

So, to solve your problem, use an MDI Project and put the toolbar on the MDI Form.

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top