set controls properties all at once

thejeraldo

Well-known member
Joined
Jun 9, 2009
Messages
70
Location
Philippines
Programming Experience
1-3
is there any way that i can set the property of a control all at once? like for every button, i want their backcolor to be red. something like that.

also is it advisable to set the properties of a control in design view rather than code it? does it have any performance issues? thanks!
 
Select multiple controls in Design view by regular selecting methods, Properties window will then show the common properties for all selected objects, set a property value to apply to all.

As Visual Studio is a visual development tool you should do most of the visual design in Designer/wizards/property pages, you will figure out by experience when you need to add code to that, or when using code is more beneficial.
 
The other way is to build one in design mode and right click on it - copy - then - paste it. It will have all same properties as the first one - just change the text of course. And if they are runtime built use a sub routine and they will all be the same. You should find no performance problems b/t designtime and runtime. :cool:
 
As JohnH says, you should use the visual tools the IDE provides where you can or there's no point to having them. That said, the designer merely generates code for you, so all properties are still set in code either way. If you want to see the code generated by the designer then open the Solution Explorer, click the Show All Files button, expand your form's node and then open the Designer.vb file.
 
Back
Top