Question i need this simple code

developer_mahmoud

Well-known member
Joined
Nov 13, 2010
Messages
64
Programming Experience
1-3
i have label1 and label 2 i need with every click on the buuton if label 1 count 1 label 2 count from 1 to 1000 with every time i click on the button i mean label 2 count from 1to 1000 with every number in label 1 like
1 1
1 2
1 3
1 4
1 ....1000
2 1
2 2
2 3
2 4
2 .....1000
3 1
3 2
3 3
3 4
3 5
3 .......1000
and so on
 
I'm going to assume from that you've got 2 labels with their text property set to 1. When you click on a button if the text in label2 is less than 1000 you want to increment that by 1. When you reach 1000 you want to increment label1 by 1 and start over on label2.

Pseudo

Dim label1Counter As Integer = 1
Dim label2Counter As Integer = 1

Click button event
If label2Counter < 1000

Then:
add 1 to label2Counter
set label2.Text = label2Counter.ToString

Else:
add 1 to label1Counter
set label1.Text = label1Counter.ToString
set label2Counter to 1
set label2.Text = label1Counter.ToString
 
its ok but i need the code and i need a loop when the two labels reache 1000 it begin a gain and i need to save hat its mean every time i opened the form i must continue not to begin from the begining
 
I've given you the pseudo code to accomplish what you need minus the part of saving the values. I'm assuming something inane like this is homework and I won't write it for you. Show some effort at coding and we'll be able to show you where you're having issues.
 
Back
Top