Solved

Setting controls to a default backcolor?

Posted on 2014-01-29
3
491 Views
Last Modified: 2014-01-29
I was wondering if there is anykind of enumeration that has a default setting for colors...like this:  color.default

I ask because in my application, the user has control of the look of the app which includes setting colors. Is there a way to reset all controls to a default setting?

Thanks!
0
Comment
Question by:BlakeMcKenna
  • 2
3 Comments
 
LVL 12

Expert Comment

by:ktaczala
ID: 39819363
depends on your color scheme.

if you do this:
dim mycontrolscolor as color = button.backcolor

and save that value somewhere

you can do:
button.backcolor = mycontrolcolor

to reset it back to startup default
when I did the first part this is what I got for the default color of a button
mycolor = "{Name=Control, ARGB=(255, 240, 240, 240)}"
other controls may have different defaults, you'll have to get them all and save them
0
 
LVL 12

Accepted Solution

by:
ktaczala earned 500 total points
ID: 39819381
Found it

try this buttonx.backcolor = Control.DefaultBackColor
works for all controls
0
 

Author Closing Comment

by:BlakeMcKenna
ID: 39819403
ktaczala...that worked! I knew their had to be an object that did this!

thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Showdialog 8 29
Help with converting data format in xml file using VB.NET 11 54
Help with AsEnumerable(), LINQ 4 22
VB.NET Repostiory Pattern 7 12
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now