Alter all controls top variable in code

chrisjames25

Registered User.
Local time
Today, 02:47
Joined
Dec 1, 2014
Messages
404
Hi

I have a form that when i enter it via another form i would like the top control in it to become invisible and the rest of the controls move up the form by a hard coded number lets say 1cm.

Is there a way to achieve this without righting code for each and every control?

Cheers
 
you are making too much extra work for yourself.
 
Without knowing the reason for doing this, i'd agree with ranman

Hiding the first control is trivial.
In the form load event, add this line
Code:
 me.mycontrolname.visible=false
Substitute your control name in that line

More effort to shift the other controls.
Why is it important?
 
Shifting each control's position UP by 1cm would be
Me.ControlName.Top = Me.ControlName.Top - 567

You would either need to do this manually for each control OR look at using the control collective to cycle through controls.

In all not a lot of benefit.

If you could do so though, put the control(s) you want to disappear into the form header, set their height =0 and disable them. Then set the header's height = header's height - 567. May do what you are looking for easier.
 

Users who are viewing this thread

Back
Top Bottom