c# - prevent dropdown area from opening of combobox control in windows forms -


I have custom combo box control in windows forms. I want to achieve such functionality in which the dropdown area should not be displayed on the basis of some condition i.e. I need to stop the combo box on the basis of some condition.

I found a link where this can be achieved, but this dropdown area is preventing it from appearing completely. Apart from this, I am unable to make much changes as per my understanding of the law. Link is provided.

Just add your condition to that if statement:

  public class CustomComboBox: combo box (safe override zero WndProc (Ref message)) (if (your condition & amp; (m.msg == 0x201 || // WM_LBUTTONDOWN m.msg == 0x203)) / / WM_LBUTTONDBLCLK Return; Base VideoPro (Ref M);}}    

Comments