I am making a countdown application. Currently it display values like that 10,9,8,7,6 and so on.
But I want to display it like that
10,09,08,07,06 and so on
Regards Adeel ArshadRegards,Adeel Arshad
khushi83 Saturday, August 22, 2009 4:29 AM
Posting your code will help but here is a clue. Before displaying the numbers, check if their lenght is less than 2. If the lenght is less than two then add "0" to the number else display as is. Something like this (I did not test the code but it does provide you with the clue/logic to do what you're trying to do):
Dim myValue AsString= CStr(myNumber)
'Numbers don't have lenght property so convert to string firstDim displayValue AsString'This is the count down numbers to displayIf myValue.Lenght > 2 Then
displayValue = "0" & myValue
'Add 0 to the beginning of your numberElse
displayValue = myValue
EndIf
TextBoxDisplay.Text = displayValue
Only performance counts!
Edited bySylvaSaturday, August 22, 2009 9:34 AMCorrection
Posting your code will help but here is a clue. Before displaying the numbers, check if their lenght is less than 2. If the lenght is less than two then add "0" to the number else display as is. Something like this (I did not test the code but it does provide you with the clue/logic to do what you're trying to do):
Dim myValue AsString= CStr(myNumber)
'Numbers don't have lenght property so convert to string firstDim displayValue AsString'This is the count down numbers to displayIf myValue.Lenght > 2 Then
displayValue = "0" & myValue
'Add 0 to the beginning of your numberElse
displayValue = myValue
EndIf
TextBoxDisplay.Text = displayValue
Only performance counts!
Edited bySylvaSaturday, August 22, 2009 9:34 AMCorrection