Results 1 to 7 of 7

Thread: Resize help please?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    7
    Under Form_Resize, how do I make it so that a window 500px wide by 200px high be the smallest size the window could be?
    So the user couldn't resize it any smaller.. but can be bigger.

    Thanks.

  2. #2
    Guest
    Do you use twip or pixel measurement for your form?

    If you are using twips (the default) you could do something like:

    Code:
    Private Sub Form_Resize()
    
      If Me.Width / Screen.TwipsPerPixelX < 500 Then
        Me.Width = Screen.TwipsPerPixelX * 500
      End If
      If Me.Height / Screen.TwipsPerPixelY < 200 Then
        Me.Height = Screen.TwipsPerPixelY * 200
      End If
      
    End Sub
    Paul

    [Edited by PWNettle on 11-21-2000 at 04:13 PM]

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    7
    Pixel I believe

  4. #4
    Guest
    If you're using pixel it would be a little less involved:

    Code:
    Private Sub Form_Resize()
    
      If Me.Width < 500 Then
        Me.Width = 500
      End If
      If Me.Height < 200 Then
        Me.Height = 200
      End If
      
    End Sub
    Paul


    [Edited by PWNettle on 11-21-2000 at 04:13 PM]

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    7
    Hmm.. it isn't working

    I have a tabbed thing covering the whole form also..

  6. #6
    Guest
    Unless you have some kind of bizarre 3rd party tab control it shouldn't affect your form resizing.

    If you're wanting to do this with pixels then check the ScaleMode property of your form and make sure it's set to '3 - Pixel' instead of the default setting of '1 - Twip'. If it's on Twips and you used the values of 500x200 in the resize event the form would have to get really tiny before the code would ever kick in.

    Paul


    [Edited by PWNettle on 11-21-2000 at 04:13 PM]

  7. #7
    Guest
    Code:
    Private Sub Form_Resize()
    
      If Width < 500 * 15 Then
        Width = 500 * 15
      End If
      If Height < 300 * 15 Then
        Height = 300 * 15
      End If
      
    End Sub

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