473,394 Members | 1,750 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,394 software developers and data experts.

Take Action When Item Selected in Combo

As a newcomer to .Net I'm continually frustrated with the subtle and not so
subtle changes that have been made since VB 6.0 that don't seem to server
any real purpose other than to frustrate people like me. In any case, I'm
trying to do something as simple as take an action when the user selects an
item from a combo box. I've tried using the SelectedIndexChange event, but
that fires several times while the list is being populated etc. before the
form is even visible. The work around that I came up with is to set a
boolean flag when the user first clicks the control so that the desired
action in the SelectedIndexChange event is only taken after the control has
been clicked by the user. This seems like an ugly solution to me. Is there
a better way?

Bob
Nov 20 '05 #1
1 1009
"Robert A. Boudra" <rb*****@comcast.net> wrote in message
I've tried using the SelectedIndexChange event, but
that fires several times while the list is being populated etc. before the


Bob,

I have dealt with this issue by declaring "private mLoaded as
Boolean=False" at the class level then surrounding the
"SelectedIndexChanged" event action with "if mLoaded then..." It
isn't very elegant (you have to set mLoaded to true after your object
initialization code) but it is effective.

I have also learned that there are better approaches for some objects,
but I am not aware of one for the Combobox. Perhaps one of the more
knowledgeable regulars here can provide a better answer.

Charlie
Nov 20 '05 #2

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

Similar topics

2
by: B | last post by:
I'm trying to simply build a form with a combo box containing a list of states. I'd like for there to be NO default selected item, but invariably, the first item in the DataSource is being...
0
by: dbuchanan | last post by:
Hello, The actions pane locks up after selecting a listbox. I have tried all kinds of things and have narrowed it down to this. If I click in the listbox the action pane locks up. Neither a...
9
by: Kay | last post by:
Hi all, Could you tell me the best way to add a blank item(as first item) in a data binded combo box? Because I think I didn't do it right and it generate an error if the second item(after the...
1
by: Sally Chamness | last post by:
Hello everyone, Im working on a final VB.Net project which im building in Visual Studio 2005. In my application, I have a combo box with lists 10 items, when an item from the combo box is selected...
7
by: Rotsey | last post by:
Hi, I am loading a tab control on a form. The code loads textboxes and comboboxes and checkboxes, normal data entry form that loads a table row of data. I have a combo on the form above the...
6
by: Smokey Grindle | last post by:
Say I have a combo box with the following simple object Public class MyObject public ID as integer public Name as string public overrides sub ToString() as string return name end sub end...
3
by: mlevit | last post by:
Hi, I need to obtain the value of the selected item from a combo box. BEGIN IF :LOGIN_BLOCK.USER_TYPE = 'Student' THEN :GLOBAL.student_id := :LOGIN_BLOCK.ID;...
2
by: maralfarshadi | last post by:
Hello In my JSP, I have several comboboxes (located in several forms in one JSP). In the onChange event , I have : onchange="submit()" My combobox have the values : Select Item Action 1...
2
by: Hanny J | last post by:
I am making a database for a dress shop, which hires and sells prom dresses. I am creating a form where the user selects the customer using a list box and then using a combo box to select a dress....
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: 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...
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...

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.