473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

prevent the combobox from dropping?

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
Nov 16 '05 #1
5 1654
"seash" <an*******@discussions.microsoft.com> wrote:
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.
Nov 16 '05 #2
Hi
----- Paul E Collins wrote: ----

"seash" <an*******@discussions.microsoft.com> wrote
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
Nov 16 '05 #3
Hi
----- Paul E Collins wrote: ----

"seash" <an*******@discussions.microsoft.com> wrote
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
Nov 16 '05 #4
Make is

Enabled=false;

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
Nov 16 '05 #5
Make is

Enabled=false;

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: djefanten | last post by:
Hi, I have a windows form with a combobox on it (it has the DropDown as DropDownStyle, which means you can type free text in it OR you can select from a list). At the moment that combobox...
6
by: Rey | last post by:
Howdy, all. Appreciate your help. Have a one to many relation between a client and visit table. In the visit subform, I have a visittype and counselor field which are comboboxes. If I set...
3
by: seash | last post by:
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...
9
by: Steffen Laser | last post by:
Hi group, I have a problem that I already have posted to the german C# newsgroup. Since nobody could help me there, I'd like to try it here again: I set the selected item of a combobox like...
9
by: Li Pang | last post by:
I use a combobox control to populate the data. I want to prevent to change data (freeze the data in the filed). The only solution I have is to set Enabled property to "False", but it gray out the...
24
by: Charles Law | last post by:
When I click a button I don't want the click event to fire. Is this possible? In fact, what I would really like is to be able to intercept the click event, perform some action, and then prevent...
6
by: Juan Pedro Gonzalez | last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on VisualStudio's toolbar. I've been able to find some VB 6 samples, but the placeholder option is no longer available for...
3
by: oskar | last post by:
How to build a backgound gray Combobox. I've a window with lots of controls read only and a combo box with white background and it looks funny ... i'd like to change the background color to gray...
2
by: slinky | last post by:
Is there a way to have the actual listed items of a ComboBox have a different background color from the base background color - e.g. all the textboxes and combos have tan as their background color,...
2
by: Shrini76 | last post by:
Hi, I want to override certain behaviors of the combo box. So, I created a base class derived from ComboBox. What I want to achieve is to make the combobox drop up (that means when user tried to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.