2009-05-21 47 views

回答

1

你應該抓住的TabControl的選擇改變事件裏面,你關注你需要的控制。就像

private void TabControl1_SelectionChanged(object sender, EventArgs e) 
{ 
    control1.Focus(); 
} 
1

不知道我理解你的要求完全,但你可能要捕獲的的TabControl SelectionChanged事件:


public Window1() 
{ 
    InitializeComponent(); 

    TabControl1.SelectionChanged += TabControl1_SelectionChanged; 
} 

private void TabControl1_SelectionChanged(object sender, EventArgs e) 
{ 
    TabItem item = (TabItem)TabControl1.SelectedItem; 
    // Find the first control in the TabItem content and focus it? 
} 
相關問題