SORU
23 NİSAN 2009, PERŞEMBE


Wpf bağlantı düğmesi

Nasıl bağlantı düğmesi ve kullanmak istemiyorum gibi görünmek için Düğmeye yapabilir miyim ...! Köprü!

Herhangi bir öneri

CEVAP
23 NİSAN 2009, PERŞEMBE


Eğer normal Düğme stili olmasını istiyoruz ve sadece bir köprü gibi görünen bir şey istiyor musun diye bununla başlayabilirsin

<Button Margin="5" Content="Test" Cursor="Hand">
    <Button.Template>
        <ControlTemplate TargetType="Button">
            <TextBlock TextDecorations="Underline">
                <ContentPresenter />
            </TextBlock>
        </ControlTemplate>
    </Button.Template>
    <Button.Style>
        <Style TargetType="Button">
            <Setter Property="Foreground" Value="Blue" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Foreground" Value="Red" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Button.Style>
</Button>

İşte stil olarak aynı

<Style
    x:Key="LinkButton"
    TargetType="Button">
    <Setter
        Property="Template">
        <Setter.Value>
            <ControlTemplate
                TargetType="Button">
                <TextBlock
                    TextDecorations="Underline">
                <ContentPresenter /></TextBlock>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Setter
        Property="Foreground"
        Value="Blue" />
    <Style.Triggers>
        <Trigger
            Property="IsMouseOver"
            Value="true">
            <Setter
                Property="Foreground"
                Value="Red" />
        </Trigger>
    </Style.Triggers>
</Style>

ve bu gibi kullanabilirsiniz:

<Button Style="{StaticResource LinkButton}" Content="Clicky" />

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • International Secret Agents Concerts

    Internationa

    2 Aralık 2008
  • Random Act of Kindness Video Contest

    Random Act o

    18 EYLÜL 2012
  • olinerd

    olinerd

    23 AĞUSTOS 2007