473,388 Members | 1,215 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,388 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 1658
"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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.