Click here to Skip to main content
15,885,951 members
Home / Discussions / WPF
   

WPF

 
QuestionHow Do I fix this runtime error? [modified] Pin
#realJSOP15-Apr-09 2:57
mve#realJSOP15-Apr-09 2:57 
AnswerRe: How Do I fix this runtime error? Pin
Pete O'Hanlon15-Apr-09 4:10
mvePete O'Hanlon15-Apr-09 4:10 
GeneralRe: How Do I fix this runtime error? Pin
#realJSOP15-Apr-09 8:16
mve#realJSOP15-Apr-09 8:16 
GeneralRe: How Do I fix this runtime error? Pin
Pete O'Hanlon15-Apr-09 9:03
mvePete O'Hanlon15-Apr-09 9:03 
GeneralRe: How Do I fix this runtime error? Pin
#realJSOP15-Apr-09 10:18
mve#realJSOP15-Apr-09 10:18 
GeneralRe: How Do I fix this runtime error? Pin
#realJSOP16-Apr-09 4:36
mve#realJSOP16-Apr-09 4:36 
GeneralRe: How Do I fix this runtime error? Pin
#realJSOP16-Apr-09 5:01
mve#realJSOP16-Apr-09 5:01 
GeneralRe: How Do I fix this runtime error? Pin
Mark Salsbery16-Apr-09 9:53
Mark Salsbery16-Apr-09 9:53 
John Simmons / outlaw programmer wrote:
Now all I gotta do is figure out how to make the border not show up when I click it....


That will be in the control template. Here's the default template ripped from
a control on Vista:
<Style x:Key="ButtonFocusVisual">
    <Setter Property="Control.Template">
        <Setter.Value>
            <ControlTemplate>
                <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#F3F3F3" Offset="0"/>
    <GradientStop Color="#EBEBEB" Offset="0.5"/>
    <GradientStop Color="#DDDDDD" Offset="0.5"/>
    <GradientStop Color="#CDCDCD" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
<Style x:Key="ToggleButtonStyle1" TargetType="{x:Type ToggleButton}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
    <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
    <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Padding" Value="1"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ToggleButton}">
                <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" RenderDefaulted="{TemplateBinding Button.IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
                </Microsoft_Windows_Themes:ButtonChrome>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsKeyboardFocused" Value="true">
                        <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
                    </Trigger>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#ADADAD"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionWebMonthView Control in CLR Pin
GomathiR15-Apr-09 1:49
GomathiR15-Apr-09 1:49 
AnswerRe: WebMonthView Control in CLR Pin
Mark Salsbery15-Apr-09 7:15
Mark Salsbery15-Apr-09 7:15 
GeneralRe: WebMonthView Control in CLR Pin
GomathiR15-Apr-09 19:46
GomathiR15-Apr-09 19:46 
GeneralRe: WebMonthView Control in CLR Pin
Mark Salsbery16-Apr-09 9:38
Mark Salsbery16-Apr-09 9:38 
QuestionModify a XML file in Silverlight 2 ? Pin
Mohammad Dayyan14-Apr-09 18:01
Mohammad Dayyan14-Apr-09 18:01 
AnswerRe: Modify a XML file in Silverlight 2 ? Pin
Braulio Dez18-Apr-09 9:11
Braulio Dez18-Apr-09 9:11 
GeneralRe: Modify a XML file in Silverlight 2 ? Pin
Mohammad Dayyan18-Apr-09 9:18
Mohammad Dayyan18-Apr-09 9:18 
GeneralRe: Modify a XML file in Silverlight 2 ? Pin
Braulio Dez18-Apr-09 9:38
Braulio Dez18-Apr-09 9:38 
GeneralRe: Modify a XML file in Silverlight 2 ? Pin
Mohammad Dayyan18-Apr-09 9:47
Mohammad Dayyan18-Apr-09 9:47 
GeneralRe: Modify a XML file in Silverlight 2 ? Pin
Braulio Dez19-Apr-09 8:33
Braulio Dez19-Apr-09 8:33 
GeneralRe: Modify a XML file in Silverlight 2 ? Pin
Mohammad Dayyan19-Apr-09 9:12
Mohammad Dayyan19-Apr-09 9:12 
GeneralRe: Modify a XML file in Silverlight 2 ? Pin
Braulio Dez19-Apr-09 9:28
Braulio Dez19-Apr-09 9:28 
GeneralRe: Modify a XML file in Silverlight 2 ? Pin
Mohammad Dayyan19-Apr-09 9:46
Mohammad Dayyan19-Apr-09 9:46 
QuestionToggleButton with Images [SOLVED - sort of] Pin
#realJSOP14-Apr-09 9:58
mve#realJSOP14-Apr-09 9:58 
AnswerRe: ToggleButton with Images Pin
Eslam Afifi14-Apr-09 11:05
Eslam Afifi14-Apr-09 11:05 
AnswerRe: ToggleButton with Images [SOLVED - sort of] Pin
DemonPT30-Aug-11 5:07
DemonPT30-Aug-11 5:07 
QuestionVisual Studio 2008/Expression Blend Wierdness [SOLVED!!!] Pin
BlitzPackage14-Apr-09 7:23
BlitzPackage14-Apr-09 7:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.