473,398 Members | 2,812 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,398 software developers and data experts.

Obtain textbox control in combobox

How can I obtain the textbox (editing field) control of the combobox? I tried
combobox.Controls to obtain the collection of controls that the combobox
contains but it turned out to be empty. Thanks.
Nov 16 '05 #1
5 8964
Hi,

What would you do with the obtained textbox? There just might be a better
approach to solve the original problem...

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Quan Nguyen" <Qu********@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
How can I obtain the textbox (editing field) control of the combobox? I
tried
combobox.Controls to obtain the collection of controls that the combobox
contains but it turned out to be empty. Thanks.


Nov 16 '05 #2
Quan,

Can you explain more, because the textbox of the combobox is just by
instance combobox1.text

Cor

"Quan Nguyen" <Qu********@discussions.microsoft.com>
How can I obtain the textbox (editing field) control of the combobox? I
tried
combobox.Controls to obtain the collection of controls that the combobox
contains but it turned out to be empty. Thanks.

Nov 16 '05 #3
Hi,

The combobox is a native control, it does not have any controls inside of
it.

What do u want to do anyway?

What you may do is intercept what is written in that textbox with an event.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Quan Nguyen" <Qu********@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
How can I obtain the textbox (editing field) control of the combobox? I
tried
combobox.Controls to obtain the collection of controls that the combobox
contains but it turned out to be empty. Thanks.

Nov 16 '05 #4
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.

Nov 16 '05 #5
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.


Nov 16 '05 #6

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

Similar topics

5
by: Steve | last post by:
I have an unbound combobox in the form header of a continuous form. The selection in the combobox sets the where clause in a querydef which determines QryPFrmInventoryManagement. The following code...
0
by: Ken Arway | last post by:
Using .Net framework 1.1 I've got a Windows Forms application with a tab control having four tab pages. TabPage4 contains a Combobox and a TextBox, which are bound to the same XML file as a...
13
by: KKuser | last post by:
Hello: I have 20, 30 text and combo boxes on one form, and I would like to clear them up at one time using the statement "With..........End With". I used this when using VB6, but I don't know...
2
by: Scott Emick | last post by:
I cannot remember how to enable the vertical scrollbar in my textbox for which I've added combobox controls to dynamically. I have the vertical scrollbar turned on, but it is greyed out and I...
2
by: Pieter | last post by:
Hi, Using this Multiline Combobox(http://www.vbcity.com/forums/faq.asp?fid=15&cat=ListBox%2FComboBox#TID58434), doesn't allow the user to type multi line text in the texbox-part of the...
0
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
3
by: Richard | last post by:
How is the result of query placed in a unbound textbox ? Suppose CriteriaLookups has columns TableName, KeyColumn, KeyValue, DataColumn Foo,x,11,xhat Bar,z,3,xyzzy And
2
by: billa856 | last post by:
Hi, I have one projrct in MS Access. I have one form in which there is one Combobx(PalletNo_combo) and one Textbox(ShippedQuantity). Now when I select an item from Combobox then it will...
2
by: ezechiel | last post by:
Hi, I have the following (limited to problem): 2 tables: software (sw_id (pk), sop_id(fk)) sop(sop_id, sop_name, sop_nr) In the form (actually a software record): - a combobox ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
0
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...
0
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,...
0
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...

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.