Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 19th, 2003, 11:21 AM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to capture the combobox text ???

I use the DataSource like below to fill a Combobox:

comboBox1.DataSource = dataSet1.Tables["Suppliers"];
comboBox1.DisplayMember = "ProductName";

When the user types any keyboard key i use the DROPDOWN property, like below, to show all combobox itens:

this.comboBox1.DroppedDown = true;

I use the content of the Combobox text to update my database.
I have a problem when the combobox lost focus, because the combobox text is cleaned. And its impossible to update the Database.
This only occurs when the user typing a new combobox item in a combobox text.

If i disable the Drop Down property my code works whell.

There is a way to make the DROP DOWN property works together the LOST FOCUS without clearing the new Combobox Text???

Thanks...
Thomaz
 
Old September 22nd, 2003, 04:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Dear Thomaz:
Could u explain more! I couldnt get u well.

Always:),
Hovik Melkomian.
 
Old September 22nd, 2003, 08:11 AM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok MELVIK;

The problem is the (DroppedDown) property.

When one combobox receives the focus I places the property (DroppedDown = true), but when this combobox loses the focus the text was typed in the ComboboxTextfield is cleaned.

It´s impossible to capture a new text typing because the droppedDown property cleaned the Combobox Text Field.

I thank its reply....





Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBox text ts0708 Excel VBA 1 June 11th, 2007 02:05 PM
Center Text In ComboBox wb8bgy Visual Basic 2005 Basics 3 March 2nd, 2007 09:06 AM
how to capture the text in column khautinh C# 0 December 19th, 2003 01:38 PM
Capture Keystroke in a text box xgbnow Visual C++ 0 October 1st, 2003 11:34 AM
Update the combobox text ??? thomaz C# 1 September 15th, 2003 08:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.