Results 1 to 3 of 3

Thread: Limit the size of a window

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    England
    Posts
    1

    Post

    Does anyone know how I can have a minimum size when resizing a window in VB. I can do it in the resize event but the window flickers as it is resized. I've seen some applications that manage to implement this without fickering. Any ideas.

    I'm sure I've seen some example code on the net in the past but I can't find it again!

    Thanks

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Post

    try a timer then??
    Code:
    Dim defaultHeight, defaultWidth As Integer
    Private Sub Form_Load()
    Timer1.Interval = 200
    Timer2.Interval = 100
    End Sub
    Private Sub Timer1_Timer()
    If Me.Width <= defaultWidth Then
    Me.Width = defaultWidth
    End If
    If Me.Height <= defaultHeight Then
    Me.Height = defaultHeight
    End If
    End Sub
    Private Sub Timer2_Timer()
    defaultHeight = Me.Height
    defaultWidth = Me.Width
    Timer2.Enabled = False
    End Sub

  3. #3
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    I have the code I can send you, but I believe on www.codeguru.com/vb , search for subclass, i believe you'll find a nice subclass dll including some examples (including 'limit resize')

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