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

Home Posts Topics Members FAQ

ComboBox: Value before SelectedIndexCh anged occured

Dear all,

This questions seems simple to most of you, but I just couldn't figure it
out.

I have a combobox. I want to capture the value (or index) of the combo box
just **before** the user click on the box and change the value.

I know I can use a flag to remember this value. But is there any better way
to do it?

Your help will be greatly appreciated.

Anson
Nov 21 '05 #1
4 9532
"Anson" <p_o_o_n_a-n-s-o-n@t_NO_SPAM_oro ntosquare.com> schrieb:
I have a combobox. I want to capture the value (or index) of the combo box
just **before** the user click on the box and change the value.

I know I can use a flag to remember this value. But is there
any better way to do it?


I like the way of storing the previous selected index in a variable and then
check this variable.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #2
Thank you.

I guess this is the only way. Cuz i remember that in MFC, there is an event
called something like "Changing". But i guess there is no such event in VB.


"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:O8******** ******@TK2MSFTN GP12.phx.gbl...
"Anson" <p_o_o_n_a-n-s-o-n@t_NO_SPAM_oro ntosquare.com> schrieb:
I have a combobox. I want to capture the value (or index) of the combo box just **before** the user click on the box and change the value.

I know I can use a flag to remember this value. But is there
any better way to do it?
I like the way of storing the previous selected index in a variable and

then check this variable.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #3
Anson,

Could you use the MouseDown event?

hth,

Doug Glancy

"Anson" <p_o_o_n_a-n-s-o-n@t_NO_SPAM_oro ntosquare.com> wrote in message
news:OV******** ******@TK2MSFTN GP14.phx.gbl...
Dear all,

This questions seems simple to most of you, but I just couldn't figure it
out.

I have a combobox. I want to capture the value (or index) of the combo box
just **before** the user click on the box and change the value.

I know I can use a flag to remember this value. But is there any better
way
to do it?

Your help will be greatly appreciated.

Anson

Nov 21 '05 #4
Anson wrote:
Dear all,

This questions seems simple to most of you, but I just couldn't figure it
out.

I have a combobox. I want to capture the value (or index) of the combo box
just **before** the user click on the box and change the value.

I know I can use a flag to remember this value. But is there any better way
to do it?

Your help will be greatly appreciated.

Anson

Maybe store the last value in the .tag? Then when the
SelectedIndexCh anged you can do whatever checks you need and then store
the new value again in the .tag.

Rinze
Nov 21 '05 #5

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

Similar topics

4
1519
by: Dianna K | last post by:
Hi, I am trying to set the value of the a combobox with a field from a dataset. It will not set. Me.cboTypeDesc.Text = DsTitle.Tables("Title").Rows(0).Item ("genre_description") or
1
7536
by: Goos van Beek | last post by:
Hello. I'm using the following code to fill a combobox on a Windows form: private void FillCboRelation(){ using(SqlCommand sqlStatement = new SqlCommand("sp_RelationList",cnn)) { using(SqlDataReader rdReader=sqlStatement.ExecuteReader()){ while(rdReader.Read()){ cboRelation.Items.Add(rdReader.ToString()); }//end while
9
7503
by: juli jul | last post by:
Hello ,I am trying to get the comboBox value but when I am writing: MessageBox.Show(this.comboBoxdb.SelectedValue.ToString()); I get the following result: System.Data.DataRowView instead of the selected value . Why? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
9158
by: Kevin Hodgson | last post by:
I have a DataBound ComboBox, which has a text value as the Value property, and the UniqueID for that value is bound to the Combobox.Tag property. When a user makes a new selection in the combobox, I need to run a SQL Query with the UniqueID of the new value they are picking. The .SelectedIndexChanged and .SelectedValueChanged events give...
0
1807
by: zhuang | last post by:
Hi, Adding combobox to datagrid has been posted many times. I have a datagrid which has multiple combobox columns and normal textbox columns. But how could I change other combo box values at the same row when user change the value of one of the combo box. The textbox value in the same row could be changed by modifying the
1
1882
by: exxcusemee | last post by:
Hi to all, Basically my problem is that that i am trying to set the value of combobox.But problem is i dont have value of combobox.Whatever i have is the label which will render to the user whenever he/she fills the form.Actually value of the combo is unique ID that refers the master from where the value is coming. I want to set the value of...
3
1448
by: rhepsi | last post by:
Hii all, How to join two tables and a combobox value?? i have 2 combo boxes and 2 tables i have aquery: 1) Dim myselectquery As String = "SELECT pr_project_id_pk FROM tbl_projects WHERE tbl_projects.pr_project_location= ?SName"
1
2177
by: sjarmy | last post by:
I am using javascript to make a dropdownlist act like a combobox and it is work well. The issue I'm having is when the user types in the combobox and finds the selection he wants, he has to use the mouse to make the actual selection. The user wants to have the option of just hitting the enter key instead of using the mouse. He also wants to use...
3
12502
by: almisba7 | last post by:
Hi, I have a ComboBox that contain ProductIDs and a DataGridView that lists Categories which a product can be a member of. My DataGridView list ALL categories, however, it has a checkbox column that get checked when the ProductID is a member of that Category, otherwise it is unchecked. A user may also check or uncheck a category checkbox then...
0
7693
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
7917
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. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
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
6277
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...
0
5217
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...
0
3651
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...
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
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.