Я нашел эту хорошую реализацию.
private bool handleSelection=true;
private void ComboBox_SelectionChanged(object sender,
SelectionChangedEventArgs e)
{
if (handleSelection)
{
MessageBoxResult result = MessageBox.Show
("Continue change?", MessageBoxButton.YesNo);
if (result == MessageBoxResult.No)
{
ComboBox combo = (ComboBox)sender;
handleSelection = false;
combo.SelectedItem = e.RemovedItems[0];
return;
}
}
handleSelection = true;
}
источник: http://www.amazedsaint.com/2008/06/wpf-combo-box-cancelling-selection.html
f.write (str (r ['owner']) + ',' + str (r ['hostname']) + ',' + str (r ['seat']) + '\ n')