PC Review


Reply
Thread Tools Rate Thread

Combo Box coding on visual Basic.NET

 
 
Robert Repsher via .NET 247
Guest
Posts: n/a
 
      24th Sep 2004
(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>
 
Reply With Quote
 
 
 
 
Imran Koradia
Guest
Posts: n/a
 
      24th Sep 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
(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>


 
Reply With Quote
 
Larry Serflaten
Guest
Posts: n/a
 
      24th Sep 2004

"Robert Repsher via .NET 247" <(E-Mail Removed)> 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

 
Reply With Quote
 
Grumpy Aero Guy
Guest
Posts: n/a
 
      25th Sep 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
(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>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Noob need help on coding a parameter for a multi-valu Jops Microsoft Access Form Coding 0 23rd Aug 2009 05:24 AM
visual basic coding question =?Utf-8?B?c3RldmllODg4?= Microsoft Excel Misc 0 26th Nov 2006 10:24 PM
Coding Today's Date In Visual Basic lj Microsoft Excel Discussion 5 7th Aug 2006 06:59 PM
Subform Visual Basic Coding Grassy7 Microsoft Access Forms 3 12th Jan 2006 05:00 PM
Trying to create a Excel report from Visual Basic Coding =?Utf-8?B?SmFzcGVy?= Microsoft Access Getting Started 1 16th Dec 2003 09:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:43 PM.