Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Public Event Change (ControlName as String)
Public Event LostFocus (ControlName as String)
Public Event MouseDown(ControlName as String, Button As Integer, Shift As Integer, X As Single, Y As Single)
' Repeat for all textbox events
Public Sub Change(ControlName as String)
RaiseEvent Change(ControlName)
End Sub
' repeat for all events
Private gEventDispatcher as TextBoxEventDispatcher
Private Property Get EventDispatcher() as TextBoxEventDispatcher
Set EventDispatcher = gEventDispatcher
End Property
Public Property Set EventDispatcher(EventDispatcher as TextBoxEventDispatcher)
Set gEventDispatcher = EventDispatcher
End Property
Private Sub TextBox_Change()
If Not EventDispatcher Is Nothing Then EventDispatcher.Change(Name)
End Sub
' Repeat for all events
Private WithEvents gTextBoxEvents as TextBoxEventDispatcher
Set gTextBoxEvents = new TextBoxEventDispatcher
Controls.Add "Class.Control", "txtBox1", Me
With Form1!txtBox1
.Visible = True
.Width = 4000
.Height = 285
.Left = 200
.Top = 200
Set .EventDispatcher = gTextBoxEvents
End With
Private Sub gTextBoxEvents_Change(CommandName as String)
Debug.Print CommandName & " has changed"
End Sub
'To add a control
Load controlname(index)
'To remove a control
Unload controlname(index)
For lLoop = 1 To 20
Load lblObject(lLoop)
lblObject(lLoop).Visible = True
lblObject(lLoop).Caption = "Dynamic Label #" & lLoop
Next