MapInfo Pro Developers User Group

Getting initial focus for control inside docked window.

  • 1.  Getting initial focus for control inside docked window.

    Posted 12-26-2019 15:56
    Hi,

    I am basically following SAMPLES\RIBBONINTERFACE\DotNet\Docking Support Sample. I have a very simple user control with single text box for a docking window:

    <UserControl ...  Loaded="UserControl_Loaded">
      <StackPanel> <TextBox Name="txtBox"  Width="100" />  </StackPanel>
    </UserControl>

    Then in code behind:

    private void UserControl_Loaded(object sender, RoutedEventArgs e)
    {
       txtBox.Focus();
    }

    But it never gets the focus. Is there a property I should set in DockingManager.DockUserControl method to make controls inside docking window focusable?

    Thank you,

    ------------------------------
    Oleg Galis
    Trade Area Systems
    Providence RI
    ------------------------------