Define a GridSplitter and Keyboard Increment : GridSplitter « Windows Presentation Foundation « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Windows Presentation Foundation » GridSplitterScreenshots 
Define a GridSplitter and Keyboard Increment
Define a GridSplitter and Keyboard Increment
  

<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>KeyboardIncrement</TextBlock>
        <RadioButton Name="KeyboardIncrementAuto" Checked="KeyboardIncrementChanged" IsChecked="true" GroupName="KeyboardIncrementProperty">
        (default)
        </RadioButton>
        <RadioButton Name="KeyboardIncrementCols" Checked="KeyboardIncrementChanged" GroupName="KeyboardIncrementProperty">
        20
        </RadioButton>
        <RadioButton Name="KeyboardIncrementRows" Checked="KeyboardIncrementChanged" GroupName="KeyboardIncrementProperty">
        50
        </RadioButton>
        <RadioButton Name="KeyboardIncrementBoth" Checked="KeyboardIncrementChanged" GroupName="KeyboardIncrementProperty">
        100
        </RadioButton>
      </StackPanel>
  </StackPanel>
</Grid>
</Window>
//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Media
Imports System.Windows.Navigation
Imports System.Windows.Shapes

Namespace GridSplitter_Example
  Public Partial Class Window1
    Inherits Window
    Public Sub New()
      InitializeComponent()
    End Sub

    Private Sub KeyboardIncrementChanged(sender As Object, e As RoutedEventArgs)
      If CType(KeyboardIncrementAuto.IsChecked, [Boolean]) Then
        myGridSplitter.KeyboardIncrement = 1
      ElseIf CType(KeyboardIncrementCols.IsChecked, [Boolean]) Then
        myGridSplitter.KeyboardIncrement = 20
      ElseIf CType(KeyboardIncrementRows.IsChecked, [Boolean]) Then
        myGridSplitter.KeyboardIncrement = 50
      ElseIf CType(KeyboardIncrementBoth.IsChecked, [Boolean]) Then
        myGridSplitter.KeyboardIncrement = 100
      End If
    End Sub

  End Class
End Namespace

   
    
  
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.GridSplitter and DragIncrement ChangedGridSplitter and DragIncrement Changed
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.