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.
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
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
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.
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 :@
Try something like this:
On mouse down event or something idk
If there is one single event for all control just use
On mouse down event or something idk
If there is one single event for all control just use
Code: Select all
Or if it is something else, multi events, do the loopif typeof sender is button then
if ctype(sender,button).tag = "NOTMOVABLE" exit sub
End if
Code: Select all
When you do the loop you have to check if it is type button.For each ctrl as control in controls()
if typeof ctrl is button then
'SOMETHING
end if
end if
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023