Page 1 of 1

Controls Help

Posted: Wed Jul 25, 2012 2:40 pm
by muttley1968
Hello i would like to know if there is a way to make all controlls able to move i allready have a system to move them and i know it works but what i want to know is can i make it soo if the type of a control is a button it will move to any postion on the form and rember that that is were it is like on windows desktop for example

Re: Controls Help

Posted: Wed Jul 25, 2012 2:46 pm
by comathi
Well, I guess you could loop through all the controls on the form, and if it happens to be a Button, write it's location to a text file. When reloading the form, you could read from that file to determine the position of the Buttons on the form.

Re: Controls Help

Posted: Wed Jul 25, 2012 3:59 pm
by muttley1968
i suppose but how could i make all buttons able to move i was thinking of useing a if type of something is something then doo that controls setting but i dont think that would work would it what am i going to put it under i have no event that can allways run it unless i use a timer but that would be there is a small gap time when it wouldnt work and people might end up clicking it at the time wich would be an error :@

Re: Controls Help

Posted: Wed Jul 25, 2012 6:48 pm
by M1z23R
Try something like this:

On mouse down event or something idk
If there is one single event for all control just use
Code: Select all
if typeof sender is button then
if ctype(sender,button).tag = "NOTMOVABLE" exit sub
End if
Or if it is something else, multi events, do the loop
Code: Select all
For each ctrl as control in controls()
if typeof ctrl is button then
'SOMETHING
end if
end if
When you do the loop you have to check if it is type button.