GridSplitter and DragIncrement Changed : GridSplitter « Windows Presentation Foundation « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Windows Presentation Foundation » GridSplitterScreenshots 
GridSplitter and DragIncrement Changed
GridSplitter and DragIncrement Changed
  
<Window x:Class="GridSplitter_Example.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="GridSplitter Example">
<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition Name="Col0" />
    <ColumnDefinition Name="Col1" />
    <ColumnDefinition Name="Col2" />
    <ColumnDefinition Name="Col3" />
  </Grid.ColumnDefinitions>
  <Grid.RowDefinitions>
    <RowDefinition Name="Row0" />
    <RowDefinition Name="Row1" />
    <RowDefinition Name="Row2" />
  </Grid.RowDefinitions>

  <StackPanel Grid.Row="0" Grid.Column="0" Background="Orange">
    <TextBlock>Row Col 0</TextBlock>
  </StackPanel>
  <StackPanel Grid.Row="1" Grid.Column="0" Background="Blue">
    <TextBlock>Row Col 0</TextBlock>
  </StackPanel>
  <StackPanel Grid.Row="2" Grid.Column="0" Background="Green">
    <TextBlock>Row Col 1</TextBlock>
  </StackPanel>
  <StackPanel Grid.Row="0" Grid.Column="1" Background="Purple">
    <TextBlock>Row Col 1</TextBlock>
  </StackPanel>
  <StackPanel Grid.Row="1" Grid.Column="1" Background="Red">
    <TextBlock>Row Col 1</TextBlock>
  </StackPanel>
  <StackPanel Grid.Row="2" Grid.Column="1" Background="Salmon">
   <TextBlock>Row Col 1</TextBlock>
  </StackPanel>
  <StackPanel Grid.Row="0" Grid.Column="2" Background="MediumVioletRed">
    <TextBlock>Row Col 2</TextBlock>
  </StackPanel>
  <StackPanel Grid.Row="1" Grid.Column="2" Background="SteelBlue">
    <TextBlock>Row Col 2</TextBlock>
  </StackPanel>
  <StackPanel Grid.Row="2" Grid.Column="2" Background="Olive">
    <TextBlock>Row Col 2</TextBlock>
  </StackPanel>
   
  <GridSplitter Name="myGridSplitter" Grid.Column="1" Grid.Row="1" Width="5"/>
  <StackPanel Grid.Column="3" Grid.RowSpan="3" Background="Brown">
    <TextBlock FontSize="14" Foreground="Yellow">Property Settings</TextBlock>

    <StackPanel Margin="0,5,0,0">
        <TextBlock>DragIncrement</TextBlock>
        <RadioButton Name="DragIncrementAuto" Checked="DragIncrementChanged" IsChecked="true" GroupName="DragIncrementProperty">
         (default)
        </RadioButton>
        <RadioButton Name="DragIncrementCols" Checked="DragIncrementChanged" GroupName="DragIncrementProperty">
         20
        </RadioButton>
        <RadioButton Name="DragIncrementRows" Checked="DragIncrementChanged" GroupName="DragIncrementProperty">
          50
        </RadioButton>
    </StackPanel>
  </StackPanel>
</Grid>
</Window>
//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace GridSplitter_Example
{
  public partial class Window1 : Window
  {
      public Window1()
      {
        InitializeComponent();
      }
        private void DragIncrementChanged(object sender, RoutedEventArgs e)
        {
          if ((Boolean)DragIncrementAuto.IsChecked)
            myGridSplitter.DragIncrement = 1;
          else if ((Boolean)DragIncrementCols.IsChecked)
            myGridSplitter.DragIncrement = 20;
          else if ((Boolean)DragIncrementRows.IsChecked)
            myGridSplitter.DragIncrement = 50;
        }
  
  }
}

   
    
  
Related examples in the same category
1.Define a GridSplitter and ShowsPreview ChangedDefine a GridSplitter and ShowsPreview Changed
2.GridSplitter and ResizeBehaviorChangedGridSplitter and ResizeBehaviorChanged
3.Define a GridSplitter and Resize Direction ChangedDefine a GridSplitter and Resize Direction Changed
4.Define a GridSplitter and Keyboard IncrementDefine a GridSplitter and Keyboard Increment
5.Define a GridSplitter and Vertical Alignment ChangedDefine a GridSplitter and Vertical Alignment Changed
6.Define a GridSplitter and Horizontal Alignment ChangedDefine a GridSplitter and Horizontal Alignment Changed
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.