1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| Option Explicit
'exemple basique de script exploitant le composant XScriptGUI
'par omen999
Dim oXGUI, oLabel, oTextBox, oButton, oButtonC
Class eHandler
Public Sub oButton_Click()
oXGUI.CloseForm
End Sub
Public Sub oButtonC_Click()
oButtonC.Enabled = false
End Sub
Public Sub Form_Load()
End Sub
Public Sub Form_Unload()
MsgBox "Votre mot de passe est " & oTextBox.Text
End Sub
Public Sub Form_GotFocus()
oTextBox.SetFocus
End Sub
End Class
Set oXGUI = CreateObject("XScriptGUI.XGUI")
With oXGUI
Set .EvHandler = New eHandler
Set oLabel = .AddControlAuto("Label", "oLabel", "&Mot de Passe: ")
Set oTextBox = .AddControlAuto("TextBox", "oTextBox", "",,100)'
oTextBox.PasswordChar="*"
oTextBox.MaxLength = 8
Set oButton = .AddControlAuto("Button", "oButton", "&Ok",,100,,true)
Set oButtonC = .AddControlAuto("Button", "oButtonC", "&Annuler",,100)
End With
Call oXGUI.ShowForm("test XScriptGUI") |
Partager