get form width when using A2007 Anchoring

NigelShaw

Registered User.
Local time
Today, 01:24
Joined
Jan 11, 2008
Messages
1,572
Hi,

im currently trying to collect the form width when it is resized. My form is set at 20cm and i have the anchoring of an object set to stretch down and across so the object stays with the form width however, it just seems to be the same size always. i put a message box on a button that collects the object sizes when i change the form-
Code:
Dim intFormWidth As Integer
Dim intObjWidth As Integer

intFormWidth = Me.Width
intObjWidth = Me.MyObject.Width

msgbox intFormWidth & VbCrlf & intObjWidth

what can i do to collect the visual width of the resized object & form? its frustrating me...


cheers

Nigel
 
Here is some code I have used to resize a subform if the main form is resized. It also resizes the form if the make it too small.

Code:
Me.LblSearch.Left = PosLeft
Me.tabsMain.Left = PosLeft
Me.tabsMain.Width = Me.InsideWidth - 500
Me.tabsMain.Top = 300
Me.tabsMain.Height = Me.InsideHeight - 1000
Me.LblCopyright.Width = Me.tabsMain.Width

Me.sfrmSearchResults.Left = PosLeft
Me.sfrmSearchResults.Width = Me.tabsMain.Width - 500
Me.sfrmSearchResults.Top = 1400
Me.sfrmSearchResults.Height = Me.tabsMain.Height - 1750

If Me.InsideHeight < MinHeight Then
    Me.InsideHeight = MinHeight
End If

If Me.InsideWidth < MinWidth Then
    Me.InsideWidth = MinWidth
End If
 
Hi,

im currently trying to collect the form width when it is resized. My form is set at 20cm and i have the anchoring of an object set to stretch down and across so the object stays with the form width however, it just seems to be the same size always. i put a message box on a button that collects the object sizes when i change the form-
Code:
Dim intFormWidth As Integer
Dim intObjWidth As Integer

intFormWidth = Me.Width
intObjWidth = Me.MyObject.Width

msgbox intFormWidth & VbCrlf & intObjWidth

what can i do to collect the visual width of the resized object & form? its frustrating me...


cheers

Nigel

Hi Nigel

I am a newcomer here and I am not allowed to use links in my posts yet.
But you can find an answer to your question in my last post.

Sergiy Vakshul
 

Users who are viewing this thread

Back
Top Bottom