Jumat, 03 Oktober 2014

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

 

I'm sorry that I haven't answered on this solution.

That's why I haven't found the any way to prevent this. Trying different appraoches may work in some enstances and then the textbox is filled With text again.

I endes up with this way to do it:

A userform with two textboxes, where textbox1 is formatted so you cant see the contents. Then the user has to choose textbox2, Write the numbers and click a commandbutton two continue.

I would like to have this work in a better way but sometimes you have to decide "good enough"

Thanks for all Your answers!

Torstein


Den Tirsdag, 23. september 2014 11.24 skrev "twlewis@reagan.com [ExcelVBA]" <ExcelVBA@yahoogroups.com>:


 
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: Torstein Johnsen <sejohnse@yahoo.no>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (16)
----------------------------------
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