Click here to Skip to main content
15,914,452 members
Home / Discussions / WPF
   

WPF

 
QuestionCalculate ListBoxItem Height Pin
Kevin Marois17-Jun-15 6:43
professionalKevin Marois17-Jun-15 6:43 
AnswerRe: Calculate ListBoxItem Height Pin
Richard Deeming17-Jun-15 7:54
mveRichard Deeming17-Jun-15 7:54 
GeneralRe: Calculate ListBoxItem Height Pin
Kevin Marois17-Jun-15 8:07
professionalKevin Marois17-Jun-15 8:07 
QuestionFIPS Error Pin
#realJSOP11-Jun-15 3:41
professional#realJSOP11-Jun-15 3:41 
AnswerRe: FIPS Error Pin
Richard Deeming11-Jun-15 4:24
mveRichard Deeming11-Jun-15 4:24 
GeneralRe: FIPS Error Pin
#realJSOP11-Jun-15 4:42
professional#realJSOP11-Jun-15 4:42 
QuestionHow to get Data from web-server to Silverlight-App Pin
Frygreen10-Jun-15 10:31
Frygreen10-Jun-15 10:31 
AnswerRe: How to get Data from web-server to Silverlight-App Pin
Mycroft Holmes10-Jun-15 13:05
professionalMycroft Holmes10-Jun-15 13:05 
QuestionThoughts On Building My Own Framework Pin
Kevin Marois10-Jun-15 4:42
professionalKevin Marois10-Jun-15 4:42 
AnswerRe: Thoughts On Building My Own Framework Pin
Mycroft Holmes10-Jun-15 13:02
professionalMycroft Holmes10-Jun-15 13:02 
QuestionWPF Button Style quirks Pin
Bernhard Hiller3-Jun-15 2:55
Bernhard Hiller3-Jun-15 2:55 
AnswerRe: WPF Button Style quirks Pin
Richard Deeming3-Jun-15 3:22
mveRichard Deeming3-Jun-15 3:22 
GeneralRe: WPF Button Style quirks Pin
Bernhard Hiller3-Jun-15 3:34
Bernhard Hiller3-Jun-15 3:34 
QuestionWPF Window Closing Event To Command Pin
Kevin Marois2-Jun-15 13:12
professionalKevin Marois2-Jun-15 13:12 
QuestionRe: WPF Window Closing Event To Command Pin
Richard Deeming2-Jun-15 21:53
mveRichard Deeming2-Jun-15 21:53 
QuestionWPF Stream Live Video Pin
Kevin Marois1-Jun-15 13:56
professionalKevin Marois1-Jun-15 13:56 
AnswerRe: WPF Stream Live Video Pin
Pete O'Hanlon1-Jun-15 20:41
mvePete O'Hanlon1-Jun-15 20:41 
GeneralRe: WPF Stream Live Video Pin
Kevin Marois2-Jun-15 4:06
professionalKevin Marois2-Jun-15 4:06 
GeneralRe: WPF Stream Live Video Pin
Pete O'Hanlon2-Jun-15 5:20
mvePete O'Hanlon2-Jun-15 5:20 
GeneralRe: WPF Stream Live Video Pin
Kevin Marois2-Jun-15 5:22
professionalKevin Marois2-Jun-15 5:22 
QuestionHow to change Window.Title property? Pin
econy28-May-15 3:13
econy28-May-15 3:13 
AnswerRe: How to change Window.Title property? Pin
Richard Deeming28-May-15 3:48
mveRichard Deeming28-May-15 3:48 
QuestionThe difference of Style on Button and TextBlock, Pin
econy27-May-15 10:15
econy27-May-15 10:15 
XML
<Window.Resources>
       <Style TargetType="TextBlock">
           <Setter Property="HorizontalAlignment" Value="Center" />
           <Setter Property="FontFamily" Value="Comic Sans MS"/>
           <Setter Property="FontSize" Value="20"/>
       </Style>
       <Style TargetType="{x:Type Button}" x:Key="ButtonStyle">
           <Setter Property="Height" Value="36"/>
           <Setter Property="Width" Value="60"/>
       </Style>
   </Window.Resources>
   <Grid>
       <Button Content="Button" Style="{StaticResource ButtonStyle}"/>
       <Button Content="Button" Style="{StaticResource ButtonStyle}" Margin="156,144,286,145" />
       <TextBlock HorizontalAlignment="Left" Margin="108,38,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="154" Height="40"/>
   </Grid>


I am a rookie in WPF, I am wonder why the Button need :
Style="{StaticResource ButtonStyle}" , a explicit Style syntax.

But the TextBlock don't need it.

Thanks
AnswerRe: The difference of Style on Button and TextBlock, Pin
Mycroft Holmes27-May-15 13:02
professionalMycroft Holmes27-May-15 13:02 
GeneralRe: The difference of Style on Button and TextBlock, Pin
econy28-May-15 3:10
econy28-May-15 3:10 

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.