469,086 Members | 1,262 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,086 developers. It's quick & easy.

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 5630
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.