Results 1 to 3 of 3

Thread: resizing (difficult 'cause it involves the line control)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281

    Hi,

    As I'm sure a lot of you know there seems to be a lot of difficulty in resizing a form with the line control on it, for some reason. I did a search and found a cool tip by Karl Moore or someone but at the end of course it had to say, 'Works with all except the Line control).

    So basically I have a form1 with line controls on it. Does anybody know, and how, I could have these controls resized to fit my form proportionately, when I drag the boundaries of my form to make it biggere or smaller?

    Thanks for any help!

  2. #2
    Member
    Join Date
    Oct 2000
    Posts
    47
    listen...i also recently had the same problem .
    my problem was / and still remains , is that i'm programing in a 1024-768 resulotion and my application looks too god damn huge in a 800-600 resulotion...

    so i had this code which solved it all :


    Private Function ResizeSomeForm()
    Dim i As Integer
    ReDim con(1 To 40)
    For Each ctrl In Controls
    i = i + 1
    On Error Resume Next
    con(i) = Round(Main.ScaleWidth / ctrl.FontSize, 0)
    Next ctrl

    Main.Move Screen.Width / (1024 * Screen.TwipsPerPixelX) * Main.Left, _
    Screen.Height / (768 * Screen.TwipsPerPixelY) * Main.Top, _
    Screen.Width / (1024 * Screen.TwipsPerPixelX) * Main.Width, _
    Screen.Height / (768 * Screen.TwipsPerPixelY) * Main.Height

    For Each ctrl In Controls
    ctrl.Move Screen.Width / (1024 * Screen.TwipsPerPixelX) * ctrl.Left, _
    Screen.Height / (768 * Screen.TwipsPerPixelY) * ctrl.Top, _
    Screen.Width / (1024 * Screen.TwipsPerPixelX) * ctrl.Width, _
    Screen.Height / (768 * Screen.TwipsPerPixelY) * ctrl.Height
    Next ctrl

    i = 0

    For Each ctrl In Controls
    i = i + 1
    ctrl.FontSize = Round(Main.ScaleWidth / con(i))
    Next ctrl

    End Function


    'though the drive box control didn't resize from some reason...

    i hope this code i gave you helped you...
    you said you have a code which have resized the controls , can you tell what was it?
    DealMan

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281

    Dealman,

    I tried your code but it didn't work - well it made my command button shrink until it disappeared, but that wasn't what I wanted.

    But I discovered a ton of resize code at planet-source-code.com. Just type resiz in the search facility, and you'll see what I mean.

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