English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

how to restrict or check number of times a command button is click repeatedly in visual basic 6

2006-08-30 03:58:26 · 3 answers · asked by thehebronite 1 in Computers & Internet Programming & Design

3 answers

You can't just put x = x + 1...that's an incomplete answer.

You can have either a static variable in the click even that is a datestamp or you can make it a global to your application. Each time you enter the click event you can use the datediff function to see if enough time has elapsed to continue with the event.

'Declare global and initialize it for the first time you enter the click event
public tPreviousClick as date = '1/1/00'

'click event

dim x as integer

'find elapsed time in seconds (s) or minutes (n)
x = datediff('s',tPreviousClick, now)
if x > 90 then '90 seconds as example
dowhatever
tPreviousClick = now 'set new PreviousClick Time
end if

2006-08-30 04:14:27 · answer #1 · answered by Anonymous · 0 0

in the button click event put the following:

dim x as integer

x = x + 1

"x" will tell you how many times the button has been clicked

2006-08-30 04:02:11 · answer #2 · answered by Yoi_55 7 · 0 0

properly, you gotta try this manually. Parse the quantity. If it have 3 digits, it would say number1 & " hundred" & number2n3 there's no automated function to try this. you have have been given to do it the no longer uncomplicated way. btw, in case you do no longer pick to create the code your self, perchance you will possibly desire to Google the code so which you are able to apply. There are zillions of code for it.

2016-11-06 01:47:49 · answer #3 · answered by Erika 4 · 0 0

fedest.com, questions and answers