0

I have windows form lab created in which I enter plane name and location, direction, speed and send it to listbox..

I need to show how many have i created in a lbl form.. which goes like this:

Number of planes created: (number)

how can I write this in code? In airplane class I have method with numberCreated++ do i have to do something with that? Hope someone can help me without looking at the code.

Thanks in advance.

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by abelLazm
0

in listbox the data is whatever I have created for example:

this is how my form is:

Name: txtbox asking for name
X: asking for lcation Y: location
direction: (direction number) Speed: speed of airline

and i hit create button where the name of the airline goes to listbox and when selected i have lbls down of form where hiden information appears. So, i have another lbl below that also reads:

Number of planes created (assume each time i create those names gets counted): (number of planes added)

0

If you are counting the number of planes created then what's the problem??? You just use

MessageBox.Show(numberCreated+" have been created so far");
0

Thats what i thought but its not messagebox.. problem is that it needs to be label. which is confusing me because when i double click on that lbl that I have created to show the number.. I can't jst say numberCreated++; right?

0

Create an invisible label in your form and when you want to show the number of planes created just show like

lblShow.Text=numberCreated+" have been created so far";
lblShow.Visible=true;

and when its work finished then just add this line

lblShow.Visible=false;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.