1
這種情況:WPF:StackOverFlowException迭代電網
我試圖做一個額外的格式,以我的tooglesbuttons
private void PanelToggles_Checked(object sender, RoutedEventArgs e)
{
ToggleButton currentTB = sender as ToggleButton;
if (currentTB != null)
{
foreach (UIElement tb in GridToggles.Children)
{
MessageBox.Show(tb.GetType().ToString());
(tb as ToggleButton).IsChecked = false;
}
currentTB.IsChecked=true;
currentTB.FontWeight = FontWeights.Bold;
//implementation
}
}
它拋出StackOverFlowException,一些想法?
你救了我的命! – 2011-01-06 08:21:34