2012-03-16 9 views

답변

1

예 :

// Enumerate all the descendants of the visual object. 
static public void EnumVisual(Visual myVisual) 
{ 
    for (int i = 0; i < VisualTreeHelper.GetChildrenCount(myVisual); i++) 
    { 
     // Retrieve child visual at specified index value. 
     Visual childVisual = (Visual)VisualTreeHelper.GetChild(myVisual, i); 

     // Do processing of the child visual object. 

     // Enumerate children of the child visual object. 
     EnumVisual(childVisual); 
    } 
} 
1

TabItem의 재산 내용에서 하나의 컨트롤이 포함되어 있습니다.

1

당신을 TabControl의 TabItem의 루프 의미하는 경우 :

public MainWindow() 
    { 
     InitializeComponent(); 

     DispatcherTimer timer = new DispatcherTimer(DispatcherPriority.Background, Dispatcher); 
     timer.Interval = TimeSpan.FromSeconds(1); 
     timer.Tick += new EventHandler(timer_Tick); 
     timer.Start(); 
    } 

    private int _selectedItem = 0; 
    void timer_Tick(object sender, EventArgs e) 
    { 
     tabControl.SelectedItem = tabControl.Items[_selectedItem]; 
     _selectedItem = (_selectedItem + 1) % tabControl.Items.Count; 
    }