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

ComboBox: Value before SelectedIndexChanged 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 9504
"Anson" <p_o_o_n_a-n-s-o-n@t_NO_SPAM_orontosquare.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**************@TK2MSFTNGP12.phx.gbl...
"Anson" <p_o_o_n_a-n-s-o-n@t_NO_SPAM_orontosquare.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_orontosquare.com> wrote in message
news:OV**************@TK2MSFTNGP14.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
SelectedIndexChanged 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
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
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)) {...
9
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...
2
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...
0
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...
1
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...
3
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...
1
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...
3
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...

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.