#623 – Focusable Property Indicates Whether a Control Can Receive Focus

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 Focusabletrue by default:

  • Button
  • Calendar
  • ComboBox
  • DataGrid
  • DatePicker
  • ListBox
  • RichTextBox
  • Slider
  • TabControl
  • TextBox
  • TreeView
  • Window

Elements that have Focusablefalse 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
Advertisements

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

4 Responses to #623 – Focusable Property Indicates Whether a Control Can Receive Focus

  1. Pingback: Dew Drop – August 13, 2012 (#1,383) | Alvin Ashcraft's Morning Dew

  2. koos says:

    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??

  3. Pingback: #639 – Default Tab Order Is Sensible « 2,000 Things You Should Know About WPF

  4. Pingback: #641 – The Difference Between IsTabStop and Focusable « 2,000 Things You Should Know About WPF

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: