Selasa, 23 September 2014

RE: Vedr: [ExcelVBA] Preventing keyboard use before userform shows

 

Torstein, what if you set the "enable" property of the textbox to be false, and then set it to true in the UserForm initialize?

In Thisworkbook:

Private Declare Function sndPlaySound32 _
    Lib "winmm.dll" _
    Alias "sndPlaySoundA" ( _
        ByVal lpszSoundName As String, _
        ByVal uFlags As Long) As Long

Sub SoundTest()
sndPlaySound32 "C:\Windows\Media\Chimes.wav", 0&
UserForm1.Show
End Sub

 

In the UserForm code:

Private Sub UserForm_Initialize()
TextBox1.Enabled = True
End Sub

 

Tim

 

 

-----Original Message-----
From: "Torstein Johnsen sejohnse@yahoo.no [ExcelVBA]" <ExcelVBA@yahoogroups.com>
Sent: Tuesday, September 23, 2014 3:39am
To: "ExcelVBA@yahoogroups.com" <ExcelVBA@yahoogroups.com>
Subject: Vedr: [ExcelVBA] Preventing keyboard use before userform shows

 
Hi Dave! Now I have tried to make this initializing procedure
 
Private Sub UserForm_Initialize()
 
TextBox1.Value = ""
 

End Sub
But when  the userforms shows it still have the numbers that is typed while the sound plays in the textbox.
Strange!
Thank you for your support so far, if necessary I can attach a file copy and send it to one of the moderators!
Torstein
 

__._,_.___

Posted by: twlewis@reagan.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (15)
----------------------------------
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