C# wpf --- How do I have the first keyboard entries start in a specific TextBox when the dialog box is opened? TabIndex does not do that.
C#
C# wpf --- How do I have the first keyboard entries start in a specific TextBox when the dialog box is opened? TabIndex does not do that.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 12, 2024, 11:49 PM EDT
You can do as below,
using System.Windows; namespace WpfApp { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void StackPanel_Loaded(object sender, RoutedEventArgs e) { gTBxNumberOfPlayers.Focus(); } } }Sam HobbsRank #107 · 20.5K reputationPosted Mar 13, 2024, 6:18 PM EDT
The following article explains the Tab Order (tab index) in WPF.
Control Class & Tab Order in WPF
https://www.c-sharpcorner.com/UploadFile/393ac5/control-class-tab-order-in-wpf
In the original Windows API the tab order was often called the Z-order.