Question:

How do you clear the random number counter in Visual Basic 6.0?

by  |  earlier

0 LIKES UnLike

I have created a program in visual basic where a textbox displays the number of times the number "1" appears in the random number generater and that works fine but i can't clear it...i want to clear the textbox and kepp going so that it starts again from "0".

so far i've managed to clear the text box but when i start creating more random numbers for the textbox it just adds onto the number that was there before i cleared, this sounds a bit confusing but anyonehelp me?

 Tags:

   Report

1 ANSWERS


  1. Use a variable to store the result of the counter, overwriting instead of adding, and simply make sure the textbox' .Text is overwritten by re-assigning the resulting value to it:

    textbox.Text = counter

    This is default behavior of the textbox, so it looks like you've got a wrong way of setting the actual counter variable... hard to say without code.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.