Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. GridSplitter Cursor

GridSplitter Cursor

Scheduled Pinned Locked Moved WPF
csharpwpfhelpquestion
6 Posts 6 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Johan Lombaard
    wrote on last edited by
    #1

    I have a WPF form with a gridsplitter. The cursor is set to SizeWE, but it does not show the resize cursor on a mouseover. I can use it for resizing, so the control can grab the mouse. Has anyone seen this problem? Any ideas?

    Johan Lombaard Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein

    L S 2 Replies Last reply
    0
    • J Johan Lombaard

      I have a WPF form with a gridsplitter. The cursor is set to SizeWE, but it does not show the resize cursor on a mouseover. I can use it for resizing, so the control can grab the mouse. Has anyone seen this problem? Any ideas?

      Johan Lombaard Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Can you post your XAML please.

      Cheers, Karl » CodeProject 2008 MVP, CodeProject 2009 MVP My Blog | Mole's Home Page | XAML Power Toys Home Page

      Just a grain of sand on the worlds beaches.

      B 1 Reply Last reply
      0
      • J Johan Lombaard

        I have a WPF form with a gridsplitter. The cursor is set to SizeWE, but it does not show the resize cursor on a mouseover. I can use it for resizing, so the control can grab the mouse. Has anyone seen this problem? Any ideas?

        Johan Lombaard Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein

        S Offline
        S Offline
        schiebel t
        wrote on last edited by
        #3

        hi, try to set the cursor directly to the gridspliter. you can do this in you constructor mygridSpliter.Cursor = Cursors.SizeWE;

        X 1 Reply Last reply
        0
        • S schiebel t

          hi, try to set the cursor directly to the gridspliter. you can do this in you constructor mygridSpliter.Cursor = Cursors.SizeWE;

          X Offline
          X Offline
          xsumo
          wrote on last edited by
          #4

          Setting the splitter cursor does not seem to work either. My code from the mouseEnter event. private void GridSplitter_MouseEnter(object sender, MouseEventArgs e) { GridSplitter gridSplitter = sender as GridSplitter; if (gridSplitter.Name == "Splitter1") { Splitter1.Cursor = Cursors.SizeWE; } }

          1 Reply Last reply
          0
          • L Lost User

            Can you post your XAML please.

            Cheers, Karl » CodeProject 2008 MVP, CodeProject 2009 MVP My Blog | Mole's Home Page | XAML Power Toys Home Page

            Just a grain of sand on the worlds beaches.

            B Offline
            B Offline
            bootis
            wrote on last edited by
            #5

            Hi, I have exactly the same problem. here is my complete code:

            <Grid Background="SteelBlue" x:Name="mainGrid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="250"/>
                    <ColumnDefinition Width="2\*" />
                    <ColumnDefinition Width="250" />
                </Grid.ColumnDefinitions>
                
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition Height="25" />
                </Grid.RowDefinitions> 
                
                <Border BorderThickness="4" BorderBrush="SteelBlue"  Background="White">
                    <WFDesigner:WorkflowListView x:Name="WorkflowList" Margin="10"/>
                </Border>
                
                <WFDesigner:WorkflowDetailView x:Name="WorkflowDetail" Margin="0,4" Grid.Column="1" Background="White"/>
                
                <GridSplitter HorizontalAlignment="Right" Grid.Column="1" ResizeBehavior="CurrentAndNext" Width="4" Background="Red" />
                
                <Border BorderThickness="0,4,4,4" BorderBrush="SteelBlue"  Grid.Column="2" Background="White">
                    <Grid x:Name="ToolboxProperties" DockPanel.Dock="Right">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="2\*" />
                            <RowDefinition Height="1\*" />
                        </Grid.RowDefinitions>
                        <ContentControl Content="{Binding ToolboxControl}"/>
                        <ContentControl DataContext="{Binding SelectedItem}" Content="{Binding Designer.PropertyInspectorView}" Grid.Row="1"/>
                    </Grid>
                </Border>
                
                <StatusBar Grid.Row="1" Grid.ColumnSpan="3" >
                    <TextBlock Text="{Binding Status}" Margin="5,0" />
                </StatusBar>
            </Grid>
            

            I tried overriding it by setting "Cursor" value in the GridSplitter XAML definition but it didn't work. Any idea?

            M 1 Reply Last reply
            0
            • B bootis

              Hi, I have exactly the same problem. here is my complete code:

              <Grid Background="SteelBlue" x:Name="mainGrid">
                  <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="250"/>
                      <ColumnDefinition Width="2\*" />
                      <ColumnDefinition Width="250" />
                  </Grid.ColumnDefinitions>
                  
                  <Grid.RowDefinitions>
                      <RowDefinition />
                      <RowDefinition Height="25" />
                  </Grid.RowDefinitions> 
                  
                  <Border BorderThickness="4" BorderBrush="SteelBlue"  Background="White">
                      <WFDesigner:WorkflowListView x:Name="WorkflowList" Margin="10"/>
                  </Border>
                  
                  <WFDesigner:WorkflowDetailView x:Name="WorkflowDetail" Margin="0,4" Grid.Column="1" Background="White"/>
                  
                  <GridSplitter HorizontalAlignment="Right" Grid.Column="1" ResizeBehavior="CurrentAndNext" Width="4" Background="Red" />
                  
                  <Border BorderThickness="0,4,4,4" BorderBrush="SteelBlue"  Grid.Column="2" Background="White">
                      <Grid x:Name="ToolboxProperties" DockPanel.Dock="Right">
                          <Grid.RowDefinitions>
                              <RowDefinition Height="2\*" />
                              <RowDefinition Height="1\*" />
                          </Grid.RowDefinitions>
                          <ContentControl Content="{Binding ToolboxControl}"/>
                          <ContentControl DataContext="{Binding SelectedItem}" Content="{Binding Designer.PropertyInspectorView}" Grid.Row="1"/>
                      </Grid>
                  </Border>
                  
                  <StatusBar Grid.Row="1" Grid.ColumnSpan="3" >
                      <TextBlock Text="{Binding Status}" Margin="5,0" />
                  </StatusBar>
              </Grid>
              

              I tried overriding it by setting "Cursor" value in the GridSplitter XAML definition but it didn't work. Any idea?

              M Offline
              M Offline
              mocasu
              wrote on last edited by
              #6

              Hi, This is what I do

              <GridSplitter Grid.Column="0" ResizeDirection="Columns" Background="LightGray" Width="5" MouseEnter="GridSplitter_MouseEnter" MouseLeave="GridSplitter_MouseLeave"/>

              private void GridSplitter_MouseEnter(object sender, MouseEventArgs e)
              {
              if (this.Cursor != Cursors.Wait)
              Mouse.OverrideCursor = Cursors.SizeWE;
              }

                  private void GridSplitter\_MouseLeave(object sender, MouseEventArgs e)
                  {
                      if (this.Cursor != Cursors.Wait)
                          Mouse.OverrideCursor = Cursors.Arrow;
                  }
              

              I first check if the mouse is already in Waiting mode, as I dont want the users to be able to resize the app while I am doing some other stuff. Hope it helps

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups