Controls Help

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

Controls Help
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
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Controls Help
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.
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

Re: Controls Help
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 :@
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: Controls Help
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.
4 posts Page 1 of 1
Return to “Coding Help & Support”