Posted 15 years ago
by Andy Ver Murlen
Version: 9.1.0505
Platform: .NET 3.5
Environment: Windows XP (32-bit)
I have just noticed that calling Focus() on an editor (at least the Int32 and DoubleEdit editors) does not work.
Consider the following sample. Click in the second editor, then click the "Set Focus" button. You will see that focus leaves the second editor, but does not move to the first editor.
Consider the following sample. Click in the second editor, then click the "Set Focus" button. You will see that focus leaves the second editor, but does not move to the first editor.
<Window
x:Class="Sample.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Editors="clr-namespace:ActiproSoftware.Windows.Controls.Editors;assembly=ActiproSoftware.Editors.Wpf30"
Title="Window1"
Width="600"
Height="300"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Editors:Int32EditBox
x:Name="uxTextBoxOne"
Margin="3"
Width="100"
Height="21"
/>
<Editors:Int32EditBox
Margin="3"
Grid.Row="1"
Width="100"
Height="21"
/>
<Button
Grid.Row="2"
Content="Set Focus"
Click="Button_Click"
/>
</Grid>
</Window>
namespace Sample
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1
{
public Window1()
{
InitializeComponent();
}
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
uxTextBoxOne.Focus();
}
}
}