Source code of Windows XP (NT5)
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.

92 lines
2.4 KiB

  1. VERSION 5.00
  2. Begin VB.UserControl SampleControl
  3. ClientHeight = 3600
  4. ClientLeft = 0
  5. ClientTop = 0
  6. ClientWidth = 4968
  7. ScaleHeight = 3600
  8. ScaleWidth = 4968
  9. Begin VB.ComboBox ComboPlans
  10. Height = 288
  11. Left = 120
  12. Style = 2 'Dropdown List
  13. TabIndex = 4
  14. Top = 360
  15. Width = 3372
  16. End
  17. Begin VB.ListBox ListReturns
  18. Height = 2352
  19. Left = 120
  20. TabIndex = 2
  21. Top = 1080
  22. Width = 3372
  23. End
  24. Begin VB.CommandButton ButtonQuote
  25. Caption = "Get History"
  26. Height = 372
  27. Left = 3600
  28. TabIndex = 0
  29. Top = 240
  30. Width = 1212
  31. End
  32. Begin VB.Label Label2
  33. Caption = "Historical Returns"
  34. Height = 252
  35. Left = 120
  36. TabIndex = 3
  37. Top = 840
  38. Width = 3372
  39. End
  40. Begin VB.Label Label1
  41. Caption = "Current Plan"
  42. Height = 252
  43. Left = 120
  44. TabIndex = 1
  45. Top = 120
  46. Width = 3372
  47. End
  48. End
  49. Attribute VB_Name = "SampleControl"
  50. Attribute VB_GlobalNameSpace = False
  51. Attribute VB_Creatable = True
  52. Attribute VB_PredeclaredId = False
  53. Attribute VB_Exposed = True
  54. Private Sub ButtonQuote_Click()
  55. Refresh
  56. End Sub
  57. Private Sub ComboPlans_Click()
  58. Refresh
  59. End Sub
  60. Private Sub UserControl_Initialize()
  61. ComboPlans.AddItem ("Mild Growth Fund")
  62. ComboPlans.AddItem ("General Fund")
  63. ComboPlans.AddItem ("Extrememe Growth Fund")
  64. ComboPlans.ListIndex = 0
  65. End Sub
  66. Public Sub Refresh()
  67. Dim nYear As Integer
  68. Dim i As Integer
  69. Dim nPerc As Integer
  70. Dim nQuarter As Integer
  71. Dim szBuf As String
  72. ListReturns.Clear
  73. For i = 0 To 16
  74. ' Decrement the year, as appropriate.
  75. nYear = 1998 - i / 4
  76. nQuarter = (i Mod 4) + 1
  77. ' Create a random number for the percentage return.
  78. nPerc = Int((10 * Rnd) + 1)
  79. ' Create a string.
  80. szBuf = "Year " + Str$(nYear) + ", Quarter " + Str$(nQuarter) + ", " + Str$(nPerc) + "%"
  81. ' Add the string.
  82. ListReturns.AddItem (szBuf)
  83. Next i
  84. End Sub