Kamis, 18 September 2014

Vedr: [ExcelVBA] Preventing keyboard use before userform shows

 

Hi Paul and thank you for your answer, but this did not help me.

My English may prevent me from explaining this well, but to delay the userform with a wait-statement does not prevent the user from using the keyboard, writing the numbers before the userforms shows. And when it shows this numbers are in the textbox. In that way I can't test whether they remember the numbers.

Can I delete the keyboard buffer in an easy way before the userform is shown, or can I delete any content in the userform textbox before the userform is shown?

Thanks again!

Torstein


Den Torsdag, 18. september 2014 12.33 skrev "Paul Vermeulen paul.vermeulen@vulcantech.com.au [ExcelVBA]" <ExcelVBA@yahoogroups.com>:


 
Hi Torstein
 
The code to display the form executes as soon as the computer asks the sound to start playing, not necessarily when the sound has finished playing.
 
Many ways to do this, but just insert a wait statement Application.Wait (Now() + "00:00:02") or use "sleep" as per http://www.ozgrid.com/forum/showthread.php?t=89193
 
 
Paul
 
 
From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com]
Sent: Thursday, 18 September 2014 4:43 PM
To: ExcelVBA@yahoogroups.com
Subject: [ExcelVBA] Preventing keyboard use before userform shows
 
 
I'm making a memory test in Excel.
 
I play a sound With some numbers and I want the user to Write the numbers in a userform after the sound have been played.
 
But now the user is able to Write the numbers while the sound is playing, then this numbers appears in the one and only textbox I have in the userform.
 
Can I prevent this?
 
Here is my code:
 
sndPlaySound32 "D:\data-filer\data\yrkespsyk\tallhukommelse\lyder\" & lydfilnavn, 0&
 
 UserForm1.Show
 
Thanks in advance
 
Torstein
 


__._,_.___

Posted by: Torstein Johnsen <sejohnse@yahoo.no>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Improvements in Yahoo Groups Search
Searching for new groups to join is easier than ever. We've honed our algorithm to bring you better search results based on relevance and activity. Try it today!

----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------

.

__,_._,___

Tidak ada komentar:

Posting Komentar