Last active
December 18, 2015 08:29
-
-
Save pinzolo/5754639 to your computer and use it in GitHub Desktop.
[WPF]ウィンドウ表示時にデフォルトフォーカスを与える
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Windowにて FocusManager.FocusedElement を設定する --> | |
<Window x:Class="MktSys.Gui.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="Set default focus on Window shown" Height="525" Width="300" | |
FocusManager.FocusedElement="{Binding ElementName=TextBox}"> | |
<Grid> | |
<TextBox Name="TextBox" HorizontalAlignment="Left" Height="25" Margin="0" TextWrapping="Wrap" VerticalAlignment="Top"/> | |
</Grid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment