473,569 Members | 2,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with custom combobox and WndProc

hi:

i am developing a custom combobox for my company's needs that is made
up of a textbox, listbox, button. i am using c#. everything is fine
except for one issue.

in a normal combobox, when the dropdown is visible and the user clicks
anywhere else, the dropdown gets hidden. i am trying to replicate
this behavior and have tried using the Leave and LostFocus events. i
have had marginal success when my dropdown is visible and i click on
another button, for example. since the focus goes to the button (i'm
assuming), the desired behavior is had.

however, if my dropdown is visible and i click on part of the form
that has nothing on it, nothing happens. i tried to override WndProc
to listen for the WM_CAPTURECHANG ED message, but that message never
seems to get generated. i then put a normal windows combobox on the
same form and listened to its events. i notice that when i click away
from the standadr combobox and the dropdown is showing, a message
numbered 2111 (that's in hex, the decimal is 8465) is sent out.

i then monitored the messages on the listbox ( = dropdown) portion of
my custom combobox and i see this 2111 message appearing as well when
i manually close the dropdown.

so it looks like this message is what i want to be listening for,
however, no messages at all get generated when i click away from my
custom combobox. if no messages are being generated, then i don't see
how overriding WndProc is the answer to my problem.

what can i do here? i've done extensive research online and haven't
found the solution - there must be others who have written their own
comboboxes. how did you get around this problem?

thanks in advance,
jean
Jul 21 '05 #1
0 2049

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

Similar topics

11
18341
by: Timo Kunze | last post by:
Hi! If you move the mouse over an item that's part of a treeview and wider than the treeview, a tooltip showing the full item text will be displayed. I try to do this for ListBoxes and ComboBoxes. For ListBoxes I got it working, but not for the ListBox part of ComboBoxes. Do you know any sample code? Thanks in advance! Timo
2
15562
by: Simon Verona | last post by:
If I have a combobox set enabled=false then by default it will have dark grey text on a grey background. I want it to show as blue on white. I'm trying code such as : combobox.enabled=false combobox.backcolor=color.white combobox.forecolor=color.blue This sets it to dark grey text on a white background.
0
375
by: jean | last post by:
hi: i am developing a custom combobox for my company's needs that is made up of a textbox, listbox, button. i am using c#. everything is fine except for one issue. in a normal combobox, when the dropdown is visible and the user clicks anywhere else, the dropdown gets hidden. i am trying to replicate this behavior and have tried using...
9
6168
by: Duncan Barnes-Ceeney | last post by:
I’m having problems with a custom Combo box. The main problem is that I want to modify the look of the combo which includes the size of the button. To do this I have inherited from the standard combo set it as a UserPaint and provided my own paint. This along with the standard Owner Draw for the list items works fine for the DropDownList...
6
2858
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the...
5
19650
by: Blue | last post by:
We have a custom word processing type editor built with C# and .NET 2.0 and we need to support typing in languages other than English. I want to be able to use the Windows IME to enter in text similar to how it works in a text box. For example, if I put focus on a TextBox and then switch my language on the language bar to Japanese or...
1
3670
by: Saww | last post by:
Hello lately i have been trying to make a custom combobox with a few targets. 1. to create a disabled items 2. to create a seperator item I already managed both properties items. i also managed to draw both items as i want(disabled in gray, seperator as a line). the problem is the user can click on the items, both the line(since it's...
2
3244
by: Andrus | last post by:
SWF DataGridView contains combobox control. Activating combobox and pressing F4 to open dropdown menu causes strange NRE (see below). When I enter some valid value to combobox, press tab, shift+tab , 44 dropdown menu opens OK. How to fix ? How to use VCSE 2008 with .net framework source code to find the line in
3
3530
by: - HAL9000 | last post by:
I am trying to get an event when the drop-down Combo Box goes away / reverts back to showing a single item. For example, clicking the box's down arrow, to remove the drop-down window, doesn't seem to generate any event. Not even a mouse event. That seems a little odd. Besides not finding a public event method, I can't seem to find a...
0
7697
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...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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. ...
1
7672
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...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
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...
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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...

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.