Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > VB.NET > Windows Forms

Windows Forms Discussion related to Winforms application development

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2009, 3:51 AM
VB.NET Forum Enthusiast
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: Jun 2009
Location: Philippines
Age: 23
Posts: 69
Reputation: 12
thejeraldo is on a distinguished programming path ahead
Default set controls properties all at once

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-04-2009, 6:24 AM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 37
Posts: 10,173
Reputation: 1273
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

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.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-04-2009, 7:08 AM
newguy's Avatar
VB.NET Forum Miyagee
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2008
Location: Denver Co, USA
Posts: 499
Reputation: 41
newguy will become famous soon enough
Default

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.
__________________
Close Counts for Horseshoes, Handgranades, and Nuclear Missiles!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-04-2009, 7:11 AM
jmcilhinney's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Aug 2004
Location: Sydney, Australia
Age: 40
Posts: 6,006
Reputation: 538
jmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalist
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 10:32 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.