|
|
|
|
|
Code des Beispiel-Projekts avbFormXTest2
Form frmStartLogo.frm
Option Explicit
Private mLast As ucLetter
Private mMode As Boolean
Private mSteps As Collection
Private Sub Form_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
FormX.DragForm
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
Unload Me
End If
End Sub
Private Sub Form_Load()
Set mSteps = New Collection
With mSteps
.Add 2
.Add 5
.Add 9
.Add 12
.Add 1
.Add 14
.Add 4
.Add 10
.Add 0
.Add 8
.Add 15
.Add 6
.Add 13
.Add 3
.Add 11
.Add 7
End With
With Me
.Move (Screen.Width - .Width) \ 2, (Screen.Height - _
.Height) \ 2
End With
tmr.Enabled = True
End Sub
Private Sub tmr_Timer()
Dim i%
Dim nAVB As Integer
Static sAVB As Integer
If Not (mLast Is Nothing) Then
mLast.Active = False
End If
If sAVB > avb.UBound Then
Set mLast = Nothing
FormX.Transparent = fttInvisibleButOnTaskBar
sAVB = 0
For i = 0 To avb.UBound
avb(i).Visible = False
Next 'i
FormX.Transparent = fttTransparentAlways
mMode = Not mMode
Else
If mMode Then
nAVB = mSteps(sAVB + 1)
Else
nAVB = sAVB
End If
With avb(nAVB)
.Active = True
.Visible = True
.ZOrder 0
End With
Set mLast = avb(nAVB)
sAVB = sAVB + 1
FormX.Refresh
End If
End Sub
UserControl ucLetter.ctl
Option Explicit
Private pActive As Boolean
Public Property Get Active() As Boolean
Active = pActive
End Property
Public Property Let Active(ByVal New_Active As Boolean)
pActive = New_Active
Select Case pActive
Case False
chk.ForeColor = vbBlack
Case True
chk.ForeColor = vbRed
End Select
End Property
Public Property Get Caption() As String
Caption = chk.Caption
End Property
Public Property Let Caption(New_Caption As String)
chk.Caption = New_Caption
PropertyChanged "Caption"
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
chk.Caption = PropBag.ReadProperty("Caption", "")
End Sub
Private Sub UserControl_Resize()
Static sInProc As Boolean
If sInProc Then
Exit Sub
Else
sInProc = True
End If
UserControl.Size 30 * Screen.TwipsPerPixelX, _
30 * Screen.TwipsPerPixelY
sInProc = False
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "Caption", chk.Caption, ""
End Sub
|