Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to write a code using VB.NET that demonstrates how to access the Text Property of a combo box and pass it to a variable, then display it to the screen


What I have tried:

i have know clue how to go about it
Posted
Updated 7-Jul-22 8:07am
v2

1 solution

All you need is the instance of the Combobox: then you can just access the Text property.
The documentation shows you how: ComboBox.Text Property (System.Windows.Forms) | Microsoft Docs[^]
Then it's just display that's needed - and that's dependant on how you want to see it: TextBox.Text is one way, MessageBox is another, but there are probably hundreds of ways to display information!
And then there is when you want to do this: when a button is clicked, when the ComboBox is changed, on a timer ... again there are many different ways to do that as well.

So think about what the task as set is asking you to do and work from that - we can't see your homework assignment, so we can't be specific.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900