Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

VS 2010 Adding several new listbox.items.add("statement")s by clicking on button1.

$
0
0
I have looked at the 8th edition of "An Introduction to Programming Using Visual Basic 2010" by David L. Schneider.

My desired result:

I was wanting to use my button1.click to sequentially add a series of Listbox1.items.add("Statement#1"), Listbox1.Items.Add("Statement#2"), Listbox1.Items.Add("Statement#3), and Listbox.Items.Add("stament# Nth degree).

At this present time, I feel I could make numerous buttons with the same appearance and individually make button1.Visual=false after the first click and make the following button2.Visual=true. I could then introduce Listbox1.Items.clear() prior to the next Listbox.Items.Add("Statement"). However, this would take a lot of time. Besides, prior to my starting the program, I have textboxes used to enter data to be placed within certain texts strings such as Listbox.Items.Add("statement2 " & name & " statement end.") and then make all those textboxes and labels to list as visible=false.

My question is therefore how to solve this with writing less code.

1.) do I need to create a database to provide a unique value for each statement and then write a code in-between each subsequent button click for the new statement to be added?

2.) is there a simple way to only displaying the first listbox.items.add("statement") without having to display the others, and sequentially add new statements?

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>