Option Compare Database
Option Explicit
Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" (ByVal pCaller As LongPtr, _
ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As LongPtr, ByVal lpfnCB As Long) As LongPtr
Private Const cstrAlphabet As String = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ"
'Dim WithEvents mlClsAlphaCmd As ClsAlphaCmd
Private m_colAlphaCmds As Collection
Private Sub Form_Load()
Call SetAlphaButtons ' Initialise the command buttons via a class
End Sub
Private Sub SetAlphaButtons()
' Use clsAlphaCmd for the buttons for alphabet
Dim i As Integer
Dim acmd As New ClsAlphaCmd
For i = 1 To 2
Debug.Print Me.Controls("AlphaTab" & i).Caption & " - " & Me.Controls("AlphaTab" & i).Name
' Set Me.Controls("AlphaTab" & i) = mlClsAlphaCmd()
Set acmd = New ClsAlphaCmd
Call acmd.fInit(Me.Controls("AlphaTab" & i), i)
m_colAlphaCmds.Add acmd, "AlphaTab" & i
Next
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer, strAlpha As String
strAlpha = "AlphaTab" & i
For i = 1 To 27
m_colAlphaCmds.Remove strAlpha
Next
End Sub