1
  1. User selects a new value in a CComboBox.
  2. The function OnCbnSelchangeXXX() is called.

Is there a way for me to cancel the change of values in the CComboBox in the function? Under some conditions the change should be cancelled, the CComboBox keeps the old value and the user is presented with an error message.

Tika
  • 333
  • 2
  • 4
  • 9

1 Answers1

0

There is no standard way for it. You must code it manually. Keep old selection value of your combo box on each OnCbnSelchangeXXX() call, check conditions and restore it if they are met.

Rost
  • 8,779
  • 28
  • 50