prevent the combobox from dropping?

G

Guest

hi
i got this code in FAQs to prevent combobox from dropping, but i dont know how to use it in my class
here is the code,
1>when i create an object of MyCombo box class in my class the object is not showing the WndProc() function an
2>how should i pass the parameters to the function
public class MyComboBox : ComboBox
{

protected override void WndProc(ref System.Windows.Forms.Message m)
{

if(m.Msg == 0x201 //WM_LBUTTONDOWN

|| m.Msg == 0x203) //WM_LBUTTONDBLCLK

return;

base.WndProc(ref m);

}
----need hel
--seas
 
P

Paul E Collins

seash said:
i got this code in FAQs to prevent combobox
from dropping, but i dont know how to use it in
my class.
[...]
1>when i create an object of MyCombo box
class in my class the object is not showing the
WndProc() function

WndProc is a method of your form, not the ComboBox. If you add that WndProc
procedure into your inherited form class (Form1 or whatever), it should
automatically handle messages to that window.

P.
 
G

Guest

Hi


----- Paul E Collins wrote: ----

seash said:
i got this code in FAQs to prevent combobo
from dropping, but i dont know how to use it i
my class
[...
1>when i create an object of MyCombo bo
class in my class the object is not showing th
WndProc() functio

WndProc is a method of your form, not the ComboBox. If you add that WndPro
procedure into your inherited form class (Form1 or whatever), it shoul
automatically handle messages to that window

P

Hi Paul
I included the procedure code in my method but still there is dropdown in comboboxs ....
need hel
----seash
 

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

Top