472,121 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

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

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?

Sep 21 '07 #1
1 5794
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.

"ZiggyShort" wrote:
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?
Sep 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Terrence | last post: by
3 posts views Thread by Jason Kyle Baginski | last post: by
reply views Thread by BeeFirst | last post: by
36 posts views Thread by AussieRules | last post: by
4 posts views Thread by Liverpool fan | last post: by
2 posts views Thread by =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post: by
5 posts views Thread by Henry Stock | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.