#623 – Focusable Property Indicates Whether a Control Can Receive Focus
August 13, 2012 4 Comments
All controls that derive from UIElement have a Focusable property that indicate whether or not they are allowed to have focus. This property defaults to a value that makes sense for each type of control, given whether a control is meant to allow a user to interact with it by pressing keys.
Here’s a summary of some common user interface elements, with their default values for Focusable.
Elements that have Focusable = true by default:
- Button
- Calendar
- ComboBox
- DataGrid
- DatePicker
- ListBox
- RichTextBox
- Slider
- TabControl
- TextBox
- TreeView
- Window
Elements that have Focusable = false by default:
- Canvas
- DockPanel
- Grid
- Image
- Label
- ProgressBar
- ScrollBar
- Separator
- Subclasses of Shape (Ellipse, Line, Path, Polygon, Polyline and Rectangle)
- StackPanel
- TextBlock
- UniformGrid
- Viewport3D
- WrapPanel
Pingback: Dew Drop – August 13, 2012 (#1,383) | Alvin Ashcraft's Morning Dew
Awesome stuff!!
I do have 1 odd scenario… Wpf application starts up, the correct textbox has focus – (Keyboard.Focus(textBox_SearchTerm);), the weird part is when typing into this focused textbox nothing happens.. only once clicked can you type…..
Any ideas??
Pingback: #639 – Default Tab Order Is Sensible « 2,000 Things You Should Know About WPF
Pingback: #641 – The Difference Between IsTabStop and Focusable « 2,000 Things You Should Know About WPF