Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / September 2007

Tip: Looking for answers? Try searching our database.

System.Windows.Controls.Button vs System.Windows.Forms.Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ZiggyShort - 21 Sep 2007 21:44 GMT
Using a Button control, I tried to reset its colour ("color" to those of you
on the other side of the pond). I tried to use the BackColor attribute - but
that is in System.Windows.Forms.Button.
When I add "using System.Windows.Forms" I get an ambiguous usage error,
seeing as I am also "using System.Windows.Controls".

I thought it would be hoping too much to cast from  
System.Windows.Controls.Button to System.Windows.Controls.Button or even cast
back to a UIElement and then to System.Windows.Controls.Button seeing as that
is not its base class.
Any ideas?
ZiggyShort - 24 Sep 2007 10:36 GMT
I might as well answer my own question:

b.Background = System.Windows.Media.Brushes.Red;

Don't want to use System.Drawing.Brush, so either exlipicitly route it, or
"using System.Windows.Media.Brushes.

> Using a Button control, I tried to reset its colour ("color" to those of you
> on the other side of the pond). I tried to use the BackColor attribute - but
[quoted text clipped - 7 lines]
> is not its base class.
> Any ideas?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.