CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: rich text box

  1. #1
    Join Date
    Aug 2001
    Posts
    1

    rich text box

    I have 1 Rich Text Box control on a form.

    I have 1 combo box on the same form. This combo contains font-size values. Whenever any text is selected from the RichTextBox, & font-size is selected from this combo , it changes the font-size of the selected text.

    The highlight on the selected text in the Rich Text Box is maintained before & after the click of the fontstyle combo.

    But the problem is , at the point of selection of font-size from the combo, the highlight on the text in the rich text box is lost. How can i still maintain a highlight on the selected text in the Rich Text Box, even at the point of selection of font-size from the combo.

    the following is the code i have used:--

    Option Explicit



    Private Sub Form_Load()

    Dim j As Integer



    With cmbFontSize

    For j = 8 To 72 Step 2
    .AddItem j
    Next j


    End With


    End Sub


    Private Sub cmbFontSize_Click()


    rtfData.SelFontSize = cmbFontSize.Text
    rtfData.SetFocus
    End Sub



  2. #2
    Join Date
    Jul 2000
    Location
    Hawaii
    Posts
    281

    Re: rich text box

    actually all your text still is selected - It's just the way VB shows that that box is no longer in focus

    your code ran fine here with no modification


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured