Resizing a Rich Text Box and a List Box 
Author Message
 Resizing a Rich Text Box and a List Box

Hi,
  I'm using VB4 Prof. I have a form with a Rich Text Box, and a List
Box on a form.

  I want the Rich Text Box to occupy the top 3/4 of the form, and the
List Box to occupy the bottom 1/4 of the form,

  When the form is resized, I call this Resize procedure.

Private Sub Resize()
  rtbmskb.Top = 10
  rtbmskb.Left = 10
  rtbmskb.Width = frmmskb.Width - 100
  rtbmskb.Height = frmmskb.Height * 0.75
  lbIndex.Left = 10
  lbIndex.Width = frmmskb.Width - 100
  lbIndex.Top = rtbmskb.Top + rtbmskb.Height + 10
  lbIndex.Height = frmmskb.Height * 0.19
End Sub

  This sort of works, but the List Box vertical scroll bar just
doesn't line up properly, that is, the bottom arrow sometimes doesn't
show up, or partially shows up, when the form is resized.

  I doubt that I have the proper calculations in my routine for this
to work perfectly, but look forward to constructive solutions from you
folks.

Thanks,

Joe



Fri, 08 Oct 2004 02:32:46 GMT  
 Resizing a Rich Text Box and a List Box
Joe,

A form's "height" and "Width" properties refer to its "outside" height and
width; for its "inside" dimensions use "ScaleHeight" and "ScaleWidth".

Try:

Dim lTop As Long

' MOVE RICHTEXT INTO PLACE
lTop = 10
With rtbFoo
    .Move 10, lTop, Me.ScaleWidth-20, Me.ScaleHeight * 0.75
    lTop = lTop + .Height
End With

' MOVE LISTBOX INTO PLACE
lbFoo.Move 10, lTop, Me.ScaleWidth-20, Me.ScaleHeight - lTop

--A



Sun, 10 Oct 2004 03:43:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help in understanding drag drop from a list box to a rich text box

2. Colour Text Box/Class Wrapper for Rich Text Box

3. Newbie question: Rich Text Box vs. Text Box

4. help: formatting rich text box/text box

5. Rich Text Box vs. Text Box Scrolling

6. Rich Text Box or text box control

7. Looking for APIs for text box and Rich text box

8. Disabling picture resizing in rich text box

9. Resizing Rich Text Boxes on runtime

10. Limiting Access to Text Boxes, List Boxes and Combo Boxes

11. Columns in List box, when inserting text from text box (VBA)

12. rich-text LIST box

 

 
Powered by phpBB® Forum Software