Actually, you're both correct. A combobox is indeed a core Window control,
but it is internally made up of three separate windows: the combo box window
itself, the edit control, and the drop-down list control. The edit control
and list control may or may not exist, depending on the combo-box style (see
ms-help://MS.MSDNQTR.2004APR.1033/shellcc/platform/commctls/comboboxes/aboutcomboboxes.htm
for more detail on this). The thing is that these controls are Windows
controls, and not .NET controls. Therefore we deal in HWNDs and not Control
subtypes.
In order to get the HWND of the edit control of a combo box, you must use
the SendMessage Windows API call to send the CB_GETCOMBOBOXINFO message to
the combo box control. The COMBOBOXINFO structure returned by this call will
contain the edit controls HWND in its hwndItem field.
However, before you get excited, there's one huge problem which is that an
HWND to an edit box cannot be converted into a TextBoxBase, at least not as
far as I know.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uh**************@TK2MSFTNGP12.phx.gbl...
Hi,
What you may do is extend the Combobox class
What the documentation refer is that the combobox works "like" a
combination of those two controls.
also you could create your own control, take a look at www.opennetcf.org
they have an ownerdrawcontrol that will give you ideas
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Quan Nguyen" <Qu********@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com... The documentation says the combobox is composed of a textbox and a
listbox,
so I thought I could extract the textbox control out of the combobox for
use.
Actually, I'm trying to integrate a class library which enables input of
Vietnamese characters in TextBoxBase-derived controls
(http://vietpad.sourceforge.net/library.html). Since the handler accepts
only
TextBoxBase control as parameters, I would like to get the textbox
control of
the combobox. Is this possible or there is another approach to this?
Thanks.