Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets
  New Posts New Posts RSS Feed - GENERAL: XAML Markup & System Colors
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GENERAL: XAML Markup & System Colors

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: GENERAL: XAML Markup & System Colors
    Posted: 26 May 2008 at 10:53pm
Hi,

Is it possible to use system colours in Markup for Foreground & Background properties? I've tried:


Foreground="{x:Static SystemColors.ControlLightLightColor}"


As I've seen in some XAML on the web, but it didn't work.

Thanks a lot.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 12:55am
Hi,
 
You just need brush:
 
Background="{x:Static SystemColors.ControlLightLightBrush}"
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 10:20am
Thanks Oleg!

In case anyone needs a list of system color brushes, I found this: (NOTE: I don't know if this is an exhaustive list, or even if CJ Markup supports all of these colours, so your mileage may vary).


ActiveBorderBrush    Gets a SolidColorBrush that is the color of the active window's border.
ActiveCaptionBrush    Gets a SolidColorBrush that is the color of the background of the active window's title bar.
ActiveCaptionTextBrush    Gets a SolidColorBrush that is the color of the text in the active window's title bar.
AppWorkspaceBrush    Gets a SolidColorBrush that is the color of the application workspace.
ControlBrush    Gets a SolidColorBrush that is the face color of a three-dimensional display element.
ControlDarkBrush    Gets a SolidColorBrush that is the shadow color of a three-dimensional display element.
ControlDarkDarkBrush    Gets a SolidColorBrush that is the dark shadow color of a three-dimensional display element.
ControlLightBrush    Gets a SolidColorBrush that is the light color of a three-dimensional display element.
ControlLightLightBrush    Gets a SolidColorBrush that is the highlight color of a three-dimensional display element.
ControlTextBrush    Gets a SolidColorBrush that is the color of text in a three-dimensional display element.
DesktopBrush    Gets a SolidColorBrush that is the color of the desktop.
GradientActiveCaptionBrush    Gets a SolidColorBrush that is the right side color in the gradient of an active window's title bar.
GradientInactiveCaptionBrush    Gets a SolidColorBrush that is the right side color in the gradient of an inactive window's title bar.
GrayTextBrush    Gets a SolidColorBrush that is the color of disabled text.
HighlightBrush    Gets a SolidColorBrush that paints the background of selected items.
HighlightTextBrush    Gets a SolidColorBrush that is the color of the text of selected items.
HotTrackBrush    Gets a SolidColorBrush that is the color used to designate a hot-tracked item.
InactiveBorderBrush    Gets a SolidColorBrush that is the color of an inactive window's border.
InactiveCaptionBrush    Gets a SolidColorBrush that is the background color of an inactive window's title bar.
InactiveCaptionTextBrush    Gets a SolidColorBrush that is the color of the text of an inactive window's title bar.
InfoBrush    Gets a SolidColorBrush that is the background color for the ToolTip control.
InfoTextBrush    Gets a SolidColorBrush that is the text color for the ToolTip control.
MenuBarBrush    Gets a SolidColorBrush that is the background color for a menu bar.
MenuBrush    Gets a SolidColorBrush that is the color of a menu's background.
MenuHighlightBrush    Gets a SolidColorBrush that is the color used to highlight a menu item.
MenuTextBrush    Gets a SolidColorBrush that is the color of a menu's text.
ScrollBarBrush    Gets a SolidColorBrush that is the background color of a scroll bar.
WindowBrush    Gets a SolidColorBrush that is the background color in the client area of a window.
WindowFrameBrush    Gets a SolidColorBrush that is the color of a window frame.
WindowTextBrush    Gets a SolidColorBrush that is the color of the text in the client area of a window.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 10:32am
I've tested the colours (above) and it seems everything is supported except for ScrollBarBrush:


<Page xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
<ScrollViewer>
    <StackPanel>
        <TextBlock Background="{x:Static SystemColors.ActiveBorderBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.ActiveCaptionBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.ActiveCaptionTextBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.AppWorkspaceBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.ControlBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.ControlDarkBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.ControlDarkDarkBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.ControlLightBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.ControlLightLightBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.DesktopBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.GradientActiveCaptionBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.GradientInactiveCaptionBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.GrayTextBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.HighlightBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.HighlightTextBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.HotTrackBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.InactiveBorderBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.InactiveCaptionBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.InactiveCaptionTextBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.InfoBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.InfoTextBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.MenuBarBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.MenuBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.MenuHighlightBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.MenuTextBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.WindowBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.WindowFrameBrush}">Enter Text Here</TextBlock>
        <TextBlock Background="{x:Static SystemColors.WindowTextBrush}">Enter Text Here</TextBlock>
    </StackPanel>
</ScrollViewer>
</Page>

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 10:41am
Oleg, I have one further question- Is it possible to use the same system colours as the TaskDialog control? For example, I'm interested in knowing what the system colour of the MainInstructionText is.

Thanks.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 12:22pm
Hi,
it use RGB(0x00, 0x33, 0x99) in WindowsXP with enabled themes. in Classic - "SystemColors.ControlTextColor"
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.