Results 1 to 3 of 3

Thread: Control resize - please repost

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Unhappy

    Okay - I know that some time ago I saw some posts where someone had created a user control that would resize all controls whenever the user resizes the form. Of course now that I want to look at it, I can't find it! can whoever has that please repost it, or if someone else has something similiar?

    Thanks

    Andrew

  2. #2
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281

    I know there is a control called resize.ocx. Look it up on the Net. You probably have to pay for it, though.

  3. #3
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554

    Wink Some Code?

    How about some code instead and you can change it into a control and mail me one.

    I have emailed the code to you, as i still have not got the hang of this BB - all my code is always left formatted!

    DocZaf
    {;->

    '==> Code
    the following code is all in the form module
    Create a form drop some controls on it
    and resize it at runtime
    Option Explicit

    Private Type ControlsSizes
    csTop As Single
    csLeft As Single
    csWidth As Single
    csHeight As Single
    End Type
    Private AllControls() As ControlsSizes

    Private Sub Form_Initialize()

    Dim counta As Integer

    ReDim Preserve AllControls(Controls.Count - 1)
    For counta = 0 To Controls.Count - 1
    With AllControls(counta)
    .csTop = Controls(counta).Top / ScaleHeight
    .csLeft = Controls(counta).Left / ScaleWidth
    .csWidth = Controls(counta).Width / ScaleWidth
    .csHeight = Controls(counta).Height / ScaleHeight
    End With
    Next

    End Sub

    Private Sub Do_Resize()

    Dim counta As Integer

    For counta = 0 To Controls.Count - 1
    With AllControls(counta)
    Controls(counta).Move .csLeft * ScaleWidth, .csTop * ScaleHeight, .csWidth * ScaleWidth, .csHeight * ScaleHeight
    End With
    Next

    End Sub

    Private Sub Form_Resize()

    Do_Resize

    End Sub


    Sorry about the lack of comments, but its simple enoughto understand.


    Zaf


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