473,666 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_LBUTTONDBLCL K

return;

base.WndProc(re f m);

}
----need hel
--seas
Nov 16 '05 #1
5 1675
"seash" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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
1376
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 receives focus, I need to display a small form on the side of the dropped down combobox with a keyboard simulated on it. Ok, I managed to get another form floating on the side, using a good article on vbaccelerator.com, I can get the input from the...
6
7359
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 either field to drop down via Me.dropdown in the GotFocus event for the field, each time the client record changes the visittype or counselor field drops down - only have the GotFocus event set to one combobox at the moment - unless I move the cursor...
3
286
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 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) {
9
56513
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 this: myCombo.SelectedItem = 3; But after that the ComboBox displays only the first entry of the list. When I add the line
9
20211
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 field. The question is how to change the color back to white? Set the style property to "Dropdown List" is not an optional. Is there is another way to fix it. There is a solution in C++. But I need the codes in VB.Net
24
7667
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 the click from passing through to the button. Any help or suggestions much appreciated. Charles
6
3117
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 ToolbarButtons... Does anyone know how this could be done? Looking forward to hear from you,
3
2642
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 like the other controls but still dropping down the list. Thank's
2
5408
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, but upon 'dropping-down' the Combo-box's items have light-blue as their background color, then after choosing an item the result reverts back to the original tan. Is this possible? Thanks!
2
4805
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 drop down the combo box the list should always come upwards instead of dropping down). Is this possible in C#.NET? If yes, how? thanks, Shrini
0
8444
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8869
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8551
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.