Well I came up with a way to resize a control on a form and it turned out to be rather elegant so I decided to post it here:
In the Form:
VB Code:
Option Explicit ' Private m_intLastHeight As Integer Private m_intLastWidth As Integer
and:
VB Code:
Private Sub Form_Load() ' m_intLastHeight = Me.Height m_intLastWidth = Me.Width ' End Sub
and:
VB Code:
Private Sub Form_Resize() On Error GoTo Err ' Me.AnyControl.Height = Me.AnyControl.Height + Me.Height - m_intLastHeight Me.AnyControl.Width = Me.AnyControl.Width + Me.Width - m_intLastWidth ' m_intLastHeight = Me.Height m_intLastWidth = Me.Width ' Exit Sub Err: If Err.Number = 380 Then Exit Sub ' This happens when I minimize End If End Sub




Reply With Quote