Click here to Skip to main content
15,891,409 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: SL3 Resource Dictionaries Pin
#realJSOP19-May-10 0:09
mve#realJSOP19-May-10 0:09 
QuestionShapes in Rich text box Pin
r i s h a b h s17-May-10 1:46
r i s h a b h s17-May-10 1:46 
AnswerRe: Shapes in Rich text box Pin
r i s h a b h s17-May-10 18:43
r i s h a b h s17-May-10 18:43 
AnswerRe: Shapes in Rich text box Pin
Abhinav S17-May-10 20:00
Abhinav S17-May-10 20:00 
GeneralRe: Shapes in Rich text box Pin
r i s h a b h s18-May-10 6:40
r i s h a b h s18-May-10 6:40 
Questionhow to cache third party images in silverlight . Pin
sandeep.cec14-May-10 22:24
sandeep.cec14-May-10 22:24 
AnswerRe: how to cache third party images in silverlight . Pin
Abhinav S15-May-10 8:09
Abhinav S15-May-10 8:09 
QuestionResizing GridSplitter Pin
kunthavai14-May-10 11:38
kunthavai14-May-10 11:38 
Hi,

I am a beginner in WPF and following Sams WPF in 24 hrs. There is an exercise to do a FontViewer application using grid which displays the list of system fonts and let the user choose any font and view the corresponding font applied on a sample text. I tried using a GRIDSPLITTER which is not resizing at all. Here is the code.

<Window x:Class="FontViewerGrid.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="500" Width="600">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="64*" />
            <RowDefinition Height="310*" />
            <RowDefinition Height="88*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="190.667*" />
            <ColumnDefinition Width="387.333*" />
        </Grid.ColumnDefinitions>
        
            <Border Grid.ColumnSpan="2"
                    CornerRadius="6"
                    BorderThickness="1"
                    BorderBrush="Gray"
                    Background="LightGray"
                    Margin="6 5 6 5">
                <TextBlock Text="Select a font from the list below. You can change the text by typing in the region at the bottom."
                       FontSize="14" TextWrapping="Wrap" VerticalAlignment="Top"/>
            </Border>
            <ListBox x:Name="FontList"
                     Grid.Row="1"
                     Grid.RowSpan="2"
                     ItemsSource="{x:Static Fonts.SystemFontFamilies}" Margin="6,5,6,5"/>
        <GridSplitter Grid.Row="1" Grid.RowSpan="2" 
                      Grid.Column="1"
                      Width="2"
                      Background="Gray"
                      ResizeDirection="Columns"
                      ResizeBehavior="PreviousAndNext" Margin="0,1,0,5" HorizontalAlignment="Left" />
            <TextBox x:Name="SampleText"
                     Grid.Row="2"
                     Grid.Column="1"
                     MinLines="4"
                     Margin="6 5 6 5"
                     TextWrapping="Wrap"
                     ToolTip="Type here to change the preview text">
                The quick brown fox jumps over the lazy dog.
            </TextBox>
        <GridSplitter Grid.Row="1"
                      Grid.Column="1"
                      Width="2"
                      Background="Gray"
                      ResizeBehavior="PreviousAndNext"
                      ResizeDirection="Rows"/>
            <StackPanel Grid.Row="1"
                        Grid.Column="1"
                        Margin="6 5 6 5">
                <TextBlock Text="{Binding ElementName=SampleText, Path=Text}"
                           FontFamily="{Binding ElementName=FontList, Path=SelectedItem}"
                           FontSize="10"
                           TextWrapping="Wrap"
                           Margin="0 0 0 4"/>
                
                <TextBlock Text="{Binding ElementName=SampleText, Path=Text}"
                           FontFamily="{Binding ElementName=FontList, Path=SelectedItem}"
                           FontSize="16"
                           TextWrapping="Wrap"
                           Margin="0 0 0 4"/>
                
                <TextBlock Text="{Binding ElementName=SampleText, Path=Text}"
                           FontFamily="{Binding ElementName=FontList, Path=SelectedItem}"
                           FontSize="24"
                           TextWrapping="Wrap"
                           Margin="0 0 0 4"/>
                
                <TextBlock Text="{Binding ElementName=SampleText, Path=Text}"
                           FontFamily="{Binding ElementName=FontList, Path=SelectedItem}"
                           FontSize="32"
                           TextWrapping="Wrap"
                           Margin="0 0 0 4"/>
            </StackPanel>
        
    </Grid>
</Window>


Please help me in spotting the mistake.
Thanks.
AnswerRe: Resizing GridSplitter Pin
AspDotNetDev14-May-10 12:51
protectorAspDotNetDev14-May-10 12:51 
AnswerRe: Resizing GridSplitter Pin
AspDotNetDev14-May-10 12:56
protectorAspDotNetDev14-May-10 12:56 
GeneralRe: Resizing GridSplitter Pin
kunthavai14-May-10 23:04
kunthavai14-May-10 23:04 
QuestionC# WPF Developer needed in Philadelphia Pin
Ben Cadbury14-May-10 10:24
Ben Cadbury14-May-10 10:24 
AnswerRe: C# WPF Developer needed in Philadelphia Pin
Richard MacCutchan14-May-10 10:27
mveRichard MacCutchan14-May-10 10:27 
QuestionCreating a resize effect Pin
WebMaster14-May-10 7:26
WebMaster14-May-10 7:26 
AnswerRe: Creating a resize effect Pin
AspDotNetDev14-May-10 12:44
protectorAspDotNetDev14-May-10 12:44 
GeneralRe: Creating a resize effect Pin
WebMaster14-May-10 21:33
WebMaster14-May-10 21:33 
GeneralRe: Creating a resize effect Pin
WebMaster15-May-10 1:52
WebMaster15-May-10 1:52 
GeneralRe: Creating a resize effect Pin
AspDotNetDev17-May-10 17:06
protectorAspDotNetDev17-May-10 17:06 
QuestionIntercepting OrigionalSource Pin
Tristan Rhodes13-May-10 10:55
Tristan Rhodes13-May-10 10:55 
AnswerRe: Intercepting OrigionalSource Pin
Abhinav S13-May-10 18:41
Abhinav S13-May-10 18:41 
AnswerRe: Intercepting OrigionalSource Pin
#realJSOP14-May-10 1:56
mve#realJSOP14-May-10 1:56 
GeneralRe: Intercepting OrigionalSource Pin
Tristan Rhodes14-May-10 10:36
Tristan Rhodes14-May-10 10:36 
GeneralRe: Intercepting OrigionalSource Pin
#realJSOP15-May-10 4:07
mve#realJSOP15-May-10 4:07 
GeneralRe: Intercepting OrigionalSource Pin
Tristan Rhodes17-May-10 6:24
Tristan Rhodes17-May-10 6:24 
QuestionWPF Hyperlink Question Pin
Kevin Marois13-May-10 10:53
professionalKevin Marois13-May-10 10:53 

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.