Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.9 KiB

  1. VERSION 5.00
  2. Begin VB.UserControl VBComponent
  3. Alignable = -1 'True
  4. ClientHeight = 2790
  5. ClientLeft = 0
  6. ClientTop = 0
  7. ClientWidth = 5670
  8. DefaultCancel = -1 'True
  9. ScaleHeight = 2790
  10. ScaleWidth = 5670
  11. Begin VB.Timer Timer1
  12. Interval = 100
  13. Left = 120
  14. Top = 2280
  15. End
  16. Begin VB.CommandButton Command1
  17. Caption = "Start"
  18. Default = -1 'True
  19. Height = 495
  20. Left = 4200
  21. TabIndex = 1
  22. Top = 2160
  23. Width = 1215
  24. End
  25. Begin VB.Label Label1
  26. Caption = "Animation Stopped"
  27. BeginProperty Font
  28. Name = "Arial"
  29. Size = 19.5
  30. Charset = 0
  31. Weight = 400
  32. Underline = 0 'False
  33. Italic = 0 'False
  34. Strikethrough = 0 'False
  35. EndProperty
  36. ForeColor = &H00FF0000&
  37. Height = 492
  38. Left = 120
  39. TabIndex = 0
  40. Top = 120
  41. Width = 3852
  42. End
  43. End
  44. Attribute VB_Name = "VBComponent"
  45. Attribute VB_GlobalNameSpace = False
  46. Attribute VB_Creatable = True
  47. Attribute VB_PredeclaredId = False
  48. Attribute VB_Exposed = True
  49. Option Explicit
  50. Dim fAnimating As Boolean
  51. Private Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (ByVal lpOutputString As String)
  52. Public Sub StartAnimation()
  53. fAnimating = True
  54. Label1.Caption = "Animation Running"
  55. Command1.Caption = "Stop"
  56. OutputDebugString TypeName(Me) & "_StartAnimation(" & App.ThreadID & ")" & vbCrLf
  57. End Sub
  58. Public Sub StopAnimation()
  59. fAnimating = False
  60. Label1.Caption = "Animation Stopped"
  61. Command1.Caption = "Start"
  62. OutputDebugString TypeName(Me) & "_StopAnimation(" & App.ThreadID & ")" & vbCrLf
  63. End Sub
  64. Public Sub DoHelp()
  65. MsgBox "DoHelp called", vbOKOnly, "Sample Animation control"
  66. End Sub
  67. Private Sub Command1_Click()
  68. fAnimating = Not fAnimating
  69. If fAnimating = True Then
  70. StartAnimation
  71. Else
  72. StopAnimation
  73. End If
  74. End Sub
  75. Private Sub Timer1_Timer()
  76. If fAnimating = True Then
  77. Label1.ForeColor = Label1.ForeColor + Rnd(256)
  78. End If
  79. End Sub
  80. Private Sub UserControl_Initialize()
  81. Randomize Now
  82. OutputDebugString TypeName(Me) & "_Initialize(" & App.ThreadID & ")" & vbCrLf
  83. End Sub
  84. Private Sub UserControl_Resize()
  85. Command1.Move UserControl.ScaleWidth - (120 + Command1.Width), _
  86. UserControl.ScaleHeight - (120 + Command1.Height)
  87. End Sub
  88. Private Sub UserControl_Terminate()
  89. OutputDebugString TypeName(Me) & "_Terminate(" & App.ThreadID & ")" & vbCrLf
  90. End Sub