ComboBox Paste

  • Thread starter Thread starter Redivivus
  • Start date Start date
R

Redivivus

Hi

How can i disable Paste on ComboBox?

ComboBox DropDownStyle is DropDown.
ComboBox must accept only numbers.


I know how to handle keypress event to accept only digits, but how to
disable paste?


Best regards;
Mex
 
Mex,

Well, you can subclass the ComboBox and handle the WM_PASTE message in
your overriden WndProc method. However, I would say that you shouldn't do
this.

Rather, when information is pasted, figure out if it is a number, and if
it is, allow the paste. If not, then don't change the contents.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top