VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Resizing Controls at run-time

by Rejean Cloutier (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Tue 20th February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Resizing Controls at run-time

API Declarations


Private lPrevHeight As Long

Rate Resizing Controls at run-time



Private Sub Form_Resize()

    Dim lLenTemp As Long

    If lPrevWidth > 0 And lPrevHeight > 0 Then
        ' Checking Width property
        lLenTemp = Label1.Width + (Me.Width - lPrevWidth)
        If lLenTemp > 0 And lLenTemp <> Label1.Width Then
            Label1.Width = lLenTemp
        End If        
        ' Checking Height property
        lLenTemp = Label1.Height + (Me.Height - lPrevHeight)
        If lLenTemp > 0 And lLenTemp <> Label1.Height Then
            Label1.Height = lLenTemp
        End If
    End If
    lPrevWidth = Me.Width
    lPrevHeight = Me.Height

End Sub


Download this snippet    Add to My Saved Code

Resizing Controls at run-time Comments

No comments have been posted about Resizing Controls at run-time. Why not be the first to post a comment about Resizing Controls at run-time.

Post your comment

Subject:
Message:
0/1000 characters