With caption name
VB Code:
' Code on Form1 Dim strCaption As String Dim MyObject As Form Form2.Show strCaption = "Form2" For Each MyObject In Forms If MyObject.Name = strCaption Then MyObject.Width = MyObject.Width - 500 MyObject.Height = MyObject.Height - 500 Exit For End If Next





Reply With Quote