1.    31 Mar 2008 #1
    RF Guest

    Check a checkbox with the space bar


    i have the following XAML and can't seem to figure out how to make the
    checkbox react to the space bar.

    <ListView Height="132" Margin="35,0,20,48" Name="m_listViewEvents"
    <HierarchicalDataTemplate ItemsSource="{Binding Path=Items}">
    <StackPanel Orientation="Horizontal">
    <CheckBox IsChecked="{Binding Path=IsSelected}"
    <TextBlock Text="{Binding Path=Text}"

      My System SpecsSystem Spec

  2.    20 Apr 2008 #2
    Motonari Ito Guest

    RE: Check a checkbox with the space bar


    > i have the following XAML and can't seem to figure out how to make the
    > checkbox react to the space bar.
    I have the same problem - any help would be appreciated. The minimal
    reproducible code is here:

    <ListBox ItemsSource="{x:Static Fonts.SystemFontFamilies}">
    <TextBlock Text="{Binding Source}"/>

    As it turns out, a space bar does not work because key focus is not on a
    check box but on ListBoxItem. If I hit [TAB] to move the focus to the check
    box, then it works.

    Keyboard operation is essential for my application. Please, please help me.

    Thank you.

      My System SpecsSystem Spec

  3.    26 May 2008 #3
    Lemming Guest

    RE: Check a checkbox with the space bar


    Unfortunately, this simple looking scenario is not easy to solve, it's
    actually pretty complicated because getting the elements defined inside a
    DataTemplate is changes the behaviour of the ItemsControl (it adds an idea of
    "checkability" to an ItemsControl which only support "selectability").

    For your scenario, consider StackPanels or WrapPanels which would contain
    CheckBoxes for each of your items. Something like the following:

    <StackPanel KeyboardNavigation.DirectionalNavigation="Contained">
      My System SpecsSystem Spec

Similar Threads
Thread Forum
databinding to 3-state checkbox?
I am binding a 3-state checkbox to an XElement: <CheckBox Content="Summary" IsChecked="{Binding Path=Element.Value, Mode=TwoWay,...
.NET General
how to create checkbox using vbscript
Hai... how to create checkbox using vbscript can anyone help me out... Thanks & Regards, Ramji
VB Script
Welcome Center - can't get rid of it (checkbox is missing!)
Dear all, I a, used to using Windows Vista, but with a new computer purchased this morning, there is no "start-up" check-box at the bottom left...
Vista General
Checkbox in GridView Column
How to get checkbox in GridView column in WPF?
Checkbox to never see this pop-up again.
I have been trying to change my start-up procedures, and everytime I change something Vista tells me I must restart the CPU. I LIKE that message...
Vista account administration
CheckBox groups
In a usercontrol I created a toolbar with some checkboxes grouped by setting a GroupName. everything works fine. But when I use multiple instances...
No CheckBox.CheckedChanged?
It'd be nice if CheckBox had a CheckedChanged eventhandler instead of/in addition to the two separate Checked and Unchecked events.

Our Sites
  • Ten Forums
  • Eight Forums
  • Seven Forums
  • PC Help Forum
  • Help Me Bake
  • Site Links
  • Contact Us
  • Privacy and Cookies
  • About Us
    Windows Vista Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 10:02.