473,480 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Combo Box coding on visual Basic.NET

(Type your message here)
My professor left the class to learn Combo Box on our own.Building it was not a problem. But what event am I supposed toassociate with this object? How do I code so that when the userpicks from the list his/her choice is recognized as a string?The procedure-level variables in the program vary with each namein the list, so right now I have an interface that "has nobrains."
--------------------------------
From: Robert Repsher

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Fy7QX26U102OB+CsLZBhkA==</Id>
Nov 21 '05 #1
3 1463
I dont quite understand what you're looking for.

Do you want to know what the text of the selected item in the list is?
In that case you can check out the SelectedText, SelectedItem and
SelectedIndex properties.

Are you looking to find a given string you have from the list of items in
the combobox list?
In that case you can check out the FindString and FindStringExact methods.

hope that helps..
Imran.

"Robert Repsher via .NET 247" <an*******@dotnet247.com> wrote in message
news:OM**************@TK2MSFTNGP15.phx.gbl...
(Type your message here)
My professor left the class to learn Combo Box on our own. Building it was
not a problem. But what event am I supposed to associate with this object?
How do I code so that when the user picks from the list his/her choice is
recognized as a string? The procedure-level variables in the program vary
with each name in the list, so right now I have an interface that "has no
brains."
--------------------------------
From: Robert Repsher

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Fy7QX26U102OB+CsLZBhkA==</Id>
Nov 21 '05 #2

"Robert Repsher via .NET 247" <an*******@dotnet247.com> wrote

My professor left the class to learn Combo Box on our own. Building it was not a problem. But what event am I supposed to
associate with this object?

That is rather vauge. The Combobox is available from the toolbox, what
exactly did you build?

LFS

Nov 21 '05 #3
I think I now what your asking.

Add the combox to a form. Populate the "box" via the items property...click
on collection to the right, then click on the "..." and generate your list.

To extract the users choice from the combobox, the "event" is up to you.

Assume there is a command button on the form that is to extract the user's
choice upon being clicked. In the command1_click event, the combobox then
behaves like a text box....

i.e.

variablename=combobox1.text

for example.

the default event (the one that pops up when you dbl-click this control in
design view) for a combobox is the
Sub ComboBox1_SelectedIndexChanged(...)

event, which means that when a selection is made, or changed, this
subroutine runs. Within THAT sub you could also do the proverbial

variablename=combobox1.text

to capture the chosen combo boxvalue to do whatever you need to with
it......

Hope this helps....
Frank Bachman
(Grumpy Aero Guy)
"Robert Repsher via .NET 247" <an*******@dotnet247.com> wrote in message
news:OM**************@TK2MSFTNGP15.phx.gbl...
(Type your message here)
My professor left the class to learn Combo Box on our own. Building it was
not a problem. But what event am I supposed to associate with this object?
How do I code so that when the user picks from the list his/her choice is
recognized as a string? The procedure-level variables in the program vary
with each name in the list, so right now I have an interface that "has no
brains."
--------------------------------
From: Robert Repsher

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Fy7QX26U102OB+CsLZBhkA==</Id>
Nov 21 '05 #4

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

Similar topics

1
3303
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in...
1
1913
by: Rasika Wijayaratne | last post by:
Hello, Can I get feedback on these .NET coding best practices please. Thanks to Konrad Rudolph and Jon Skeet for the replies to my previous post on 'Writing Properties.' Thanks in advance to all...
5
7781
by: Sivaprasad | last post by:
Hi, I have a combo box which displays FirstName+ Last Name of a person. I want to store their id's in the combo like we store in ItemData of VB 6 combo box. Is there any itemdata equivalent in...
2
3700
by: http://www.visual-basic-data-mining.net/forum | last post by:
Hi... Say i have this string call "data" in Form1, this string contains number "5" value.... how do i pass this string to the Form2 and compare with the combo box items... The combo box ...
2
5659
by: Rod | last post by:
I want to manipulate a spreadsheet from within dotnet (using VB). I cant figure out how to get started. i.e. what is the equivalent to the VBA code On Error Resume Next Set objExcel =...
3
3322
by: ct-86 | last post by:
http://www.cdbook.cn/book.asp?id=2393 Organizational and Policy Issues 1 0. Don't sweat the small stuff. (Or: Know what not to standardize.) 2 1. Compile cleanly at high warning levels. 4 2....
4
64514
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
6
1273
by: =?Utf-8?B?ZGljazIz?= | last post by:
I am just a beginner coding in VB6. I am trying to write a simple code to add 2 numbers together and put the answer in a text box I have one textbox open to accept each number, a textbox to accept...
0
7040
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
6905
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
7041
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
5331
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
4478
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...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
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...

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.