mdi child form with rtb & scrollbars problem 
Author Message
 mdi child form with rtb & scrollbars problem

    I don't know which version of the rtb you have. The current version is 6
(service pack 4). I put this code in an MDI child form and tried it. Even
with re-sizing the width of the child window, and thus resizing the rtb, the
text remained fine. All I did was change the ScrollBars property to
rtfVertical. Otherwise, the control uses all of the defaults.
    I made the child form and control as follows:
        Form1.Height = 4110
        Form1.Width = 2895
        RichTextBox1.Height = 2655
        RichTextBox1.Width = 2535
        RichTextBox1.Left = 120
        RichTextBox1.Top = 240

    And put Command1 below the rtb. The above settings were put in the
properties window, not set programmatically. And then the code:

Private Sub Command1_Click()
    txtSample = ""
    For LoopVar = 1 To 10
        txtSample = txtSample & "This is some longer text to see if it cuts
off properly and see if it breaks words that are too long like
supercalifragilisticexpialidocious and
ifragilisticexpialidocious and if it works with the vertical scroll bar as
it should. "
    Next LoopVar
    RichTextBox1.Text = txtSample
End Sub

Private Sub Form_Resize()
    RichTextBox1.Width = Form1.Width - 360
End Sub

    If this doesn't work then you should check your version (previous ones
had bugs) or, specify what is done differently than I did.


> I have an MDI Child with a rich text box. I can't get the text to stop at
> the righ hand edge of the rtb.  I have set the property to Multiline, I
> tried all combinations of Scroll bar but nothing works.

> Any ideas anyone ??

> --
> Arnie Owen

> remove the obvious to reply

Sat, 18 Dec 2004 11:45:49 GMT  
 [ 1 post ] 

 Relevant Pages 

1. mdi child form with rtb & scrollbars problem

2. Q: Form activate Fires On Non Child MDI Forms But Only Once On Child Mdi Forms

3. Scrollbars on MDI child forms?

4. Scrollbars on MDI Child Form

5. MDI Forms & Child forms

6. MDI Form & Child Form Focus

7. Modifying object in MDI Parent form from MDI Child form

8. Make a reference to a MDI form with a reference of a MDI child form

9. MDI-Child form and positon on MDI-form

10. Developing OLE MDI Child forms displayed on Control MDI Form

11. MDI child forms on top of a picture on a MDI form

12. Help with MDI Forms and MDI child forms


Powered by phpBB® Forum Software