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.

Recommended Answers

All 5 Replies

What data you have in listbox please give a sample of data you have at the end

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)

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");

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?

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;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.