Background Brush

September 17th, 2007 - 07:26 pm ET by stein | Report spam
Is setting

Background={x:Null} equivalent to

Backgournd="Transparent"

Thanks,
matt
email Follow the discussionReplies 4 repliesReplies Make a reply

Similar topics

Replies

#1 Fred
September 18th, 2007 - 03:15 am ET | Report spam
Hey stein,

The result will look the same, but there is a small difference.
When you set Background = {x:Null} the object will simply have no background
If you set Background = "Transparent" the object will have a white
background but the alpha value of the background will be set to 0 and you
won't see the background. the color code is #00FFFFFF (ARGB)

Greetings
Frederik
http://wpf-tutorials.livejournal.com/


"stein" wrote in message
news:
Is setting

Background={x:Null} equivalent to

Backgournd="Transparent"

Thanks,
matt



Replies Reply to this message
#2 stein
September 18th, 2007 - 05:01 am ET | Report spam
Thanks,I ask because I have a WPF app hosted in MFC and I have the
following scenario within the WPF app:

Grid

I have overwritten the ListBox control template to remove the border
and just have the scroll viewer. I then overwrite the ListBoxItem
template to have a nice outerborder. Now when I select a listbox item
the border of the listbox item should overlap the border in the grid
(mBord).

However this doesn't work. In a pure WPF app it works, but in the MFC
hosted app I get the an effect where the ListBox item's border is
drawn on top of the main border (mBord), but I can still see some of
the main border. In the pure WPF app it overwrites it. That is why my
initial question was asked - I want to know if I should be using one
or the other in an app that uses WPF and MFC.

Is this a known issue?

Matt

On Sep 18, 8:15 am, "Fred" wrote:
Hey stein,

The result will look the same, but there is a small difference.
When you set Background = {x:Null} the object will simply have no background
If you set Background = "Transparent" the object will have a white
background but the alpha value of the background will be set to 0 and you
won't see the background. the color code is #00FFFFFF (ARGB)

Greetings
Frederikhttp://wpf-tutorials.livejournal.com/

"stein" wrote in message

news:



> Is setting

> Background={x:Null} equivalent to

> Backgournd="Transparent"

> Thanks,
> matt- Hide quoted text -

- Show quoted text -


Replies Reply to this message
#3 stein
September 18th, 2007 - 12:47 pm ET | Report spam
Note that I am only seeing this strange behavior on XP, not Vista...

On Sep 18, 10:01 am, stein wrote:
Thanks,I ask because I have a WPF app hosted in MFC and I have the
following scenario within the WPF app:

Grid

I have overwritten the ListBox control template to remove the border
and just have the scroll viewer. I then overwrite the ListBoxItem
template to have a nice outerborder. Now when I select a listbox item
the border of the listbox item should overlap the border in the grid
(mBord).

However this doesn't work. In a pure WPF app it works, but in the MFC
hosted app I get the an effect where the ListBox item's border is
drawn on top of the main border (mBord), but I can still see some of
the main border. In the pure WPF app it overwrites it. That is why my
initial question was asked - I want to know if I should be using one
or the other in an app that uses WPF and MFC.

Is this a known issue?

Matt

On Sep 18, 8:15 am, "Fred" wrote:



> Hey stein,

> The result will look the same, but there is a small difference.
> When you set Background = {x:Null} the object will simply have no background
> If you set Background = "Transparent" the object will have a white
> background but the alpha value of the background will be set to 0 and you
> won't see the background. the color code is #00FFFFFF (ARGB)

> Greetings
> Frederikhttp://wpf-tutorials.livejournal.com/

> "stein" wrote in message

>news:

> > Is setting

> > Background={x:Null} equivalent to

> > Backgournd="Transparent"

> > Thanks,
> > matt- Hide quoted text -

> - Show quoted text -- Hide quoted text -

- Show quoted text -


Replies Reply to this message
#4 Unni Ravindranathan \(MS\)
September 18th, 2007 - 04:11 pm ET | Report spam
This question is better asked on the WPF newsgroups - there will be more
experts there dealing with MFC hosting issues.

Fred is right as far as I can tell - setting something to x:Null will result
in it being not-hittestable - setting something to Transparent will result
in it being hit-testable. So there is a difference...

Thanks,
-Unni

"stein" wrote in message
news:
Note that I am only seeing this strange behavior on XP, not Vista...

On Sep 18, 10:01 am, stein wrote:
Thanks,I ask because I have a WPF app hosted in MFC and I have the
following scenario within the WPF app:

Grid

I have overwritten the ListBox control template to remove the border
and just have the scroll viewer. I then overwrite the ListBoxItem
template to have a nice outerborder. Now when I select a listbox item
the border of the listbox item should overlap the border in the grid
(mBord).

However this doesn't work. In a pure WPF app it works, but in the MFC
hosted app I get the an effect where the ListBox item's border is
drawn on top of the main border (mBord), but I can still see some of
the main border. In the pure WPF app it overwrites it. That is why my
initial question was asked - I want to know if I should be using one
or the other in an app that uses WPF and MFC.

Is this a known issue?

Matt

On Sep 18, 8:15 am, "Fred" wrote:



> Hey stein,

> The result will look the same, but there is a small difference.
> When you set Background = {x:Null} the object will simply have no
> background
> If you set Background = "Transparent" the object will have a white
> background but the alpha value of the background will be set to 0 and
> you
> won't see the background. the color code is #00FFFFFF (ARGB)

> Greetings
> Frederikhttp://wpf-tutorials.livejournal.com/

> "stein" wrote in message

>news:

> > Is setting

> > Background={x:Null} equivalent to

> > Backgournd="Transparent"

> > Thanks,
> > matt- Hide quoted text -

> - Show quoted text -- Hide quoted text -

- Show quoted text -






email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search