home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / ucCalendar206909642007.psc / frmTest.frm < prev    next >
Text File  |  2007-05-31  |  12KB  |  358 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTest 
  3.    Caption         =   "ucCalendar Demonstration"
  4.    ClientHeight    =   5580
  5.    ClientLeft      =   60
  6.    ClientTop       =   390
  7.    ClientWidth     =   6765
  8.    BeginProperty Font 
  9.       Name            =   "Tahoma"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   400
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    ScaleHeight     =   372
  19.    ScaleMode       =   3  'Pixel
  20.    ScaleWidth      =   451
  21.    StartUpPosition =   2  'CenterScreen
  22.    Begin VB.PictureBox Picture2 
  23.       AutoRedraw      =   -1  'True
  24.       BorderStyle     =   0  'None
  25.       Height          =   2235
  26.       Left            =   150
  27.       ScaleHeight     =   149
  28.       ScaleMode       =   3  'Pixel
  29.       ScaleWidth      =   235
  30.       TabIndex        =   15
  31.       Top             =   3270
  32.       Width           =   3525
  33.       Begin VB.CheckBox Check4 
  34.          Caption         =   "Output status messages"
  35.          Height          =   195
  36.          Left            =   60
  37.          TabIndex        =   19
  38.          Top             =   1860
  39.          Value           =   1  'Checked
  40.          Width           =   2055
  41.       End
  42.       Begin VB.CommandButton Command1 
  43.          Caption         =   "Clear"
  44.          Height          =   375
  45.          Left            =   2250
  46.          TabIndex        =   18
  47.          Top             =   1800
  48.          Width           =   1215
  49.       End
  50.       Begin VB.ListBox List1 
  51.          Height          =   1425
  52.          Left            =   60
  53.          TabIndex        =   17
  54.          Top             =   330
  55.          Width           =   3405
  56.       End
  57.       Begin VB.Label Label7 
  58.          AutoSize        =   -1  'True
  59.          BackStyle       =   0  'Transparent
  60.          Caption         =   "Event Log"
  61.          BeginProperty Font 
  62.             Name            =   "Tahoma"
  63.             Size            =   8.25
  64.             Charset         =   0
  65.             Weight          =   700
  66.             Underline       =   0   'False
  67.             Italic          =   0   'False
  68.             Strikethrough   =   0   'False
  69.          EndProperty
  70.          ForeColor       =   &H80000014&
  71.          Height          =   195
  72.          Left            =   45
  73.          TabIndex        =   16
  74.          Top             =   15
  75.          Width           =   825
  76.       End
  77.       Begin VB.Shape Shape2 
  78.          BorderStyle     =   0  'Transparent
  79.          FillColor       =   &H80000010&
  80.          FillStyle       =   0  'Solid
  81.          Height          =   255
  82.          Left            =   0
  83.          Top             =   0
  84.          Width           =   3795
  85.       End
  86.    End
  87.    Begin VB.PictureBox Picture1 
  88.       AutoRedraw      =   -1  'True
  89.       BorderStyle     =   0  'None
  90.       Height          =   4215
  91.       Left            =   3810
  92.       ScaleHeight     =   281
  93.       ScaleMode       =   3  'Pixel
  94.       ScaleWidth      =   187
  95.       TabIndex        =   1
  96.       Top             =   180
  97.       Width           =   2805
  98.       Begin VB.CheckBox Check5 
  99.          Caption         =   "Show week numbers"
  100.          Height          =   195
  101.          Left            =   60
  102.          TabIndex        =   20
  103.          Top             =   3690
  104.          Value           =   1  'Checked
  105.          Width           =   2685
  106.       End
  107.       Begin VB.ComboBox Combo4 
  108.          Height          =   315
  109.          ItemData        =   "frmTest.frx":0000
  110.          Left            =   60
  111.          List            =   "frmTest.frx":001C
  112.          Style           =   2  'Dropdown List
  113.          TabIndex        =   13
  114.          Top             =   2430
  115.          Width           =   2685
  116.       End
  117.       Begin VB.CheckBox Check3 
  118.          Caption         =   "Show month change buttons"
  119.          Height          =   195
  120.          Left            =   60
  121.          TabIndex        =   12
  122.          Top             =   3420
  123.          Value           =   1  'Checked
  124.          Width           =   2685
  125.       End
  126.       Begin VB.CheckBox Check2 
  127.          Caption         =   "Show week day names"
  128.          Height          =   195
  129.          Left            =   60
  130.          TabIndex        =   11
  131.          Top             =   3150
  132.          Value           =   1  'Checked
  133.          Width           =   2685
  134.       End
  135.       Begin VB.CheckBox Check1 
  136.          Caption         =   "Show month name and year"
  137.          Height          =   195
  138.          Left            =   60
  139.          TabIndex        =   10
  140.          Top             =   2880
  141.          Value           =   1  'Checked
  142.          Width           =   2685
  143.       End
  144.       Begin VB.ComboBox Combo3 
  145.          Height          =   315
  146.          ItemData        =   "frmTest.frx":0076
  147.          Left            =   60
  148.          List            =   "frmTest.frx":0083
  149.          Style           =   2  'Dropdown List
  150.          TabIndex        =   7
  151.          Top             =   1800
  152.          Width           =   2685
  153.       End
  154.       Begin VB.ComboBox Combo2 
  155.          Height          =   315
  156.          ItemData        =   "frmTest.frx":00AE
  157.          Left            =   60
  158.          List            =   "frmTest.frx":00BE
  159.          Style           =   2  'Dropdown List
  160.          TabIndex        =   5
  161.          Top             =   1170
  162.          Width           =   2685
  163.       End
  164.       Begin VB.ComboBox Combo1 
  165.          Height          =   315
  166.          ItemData        =   "frmTest.frx":00ED
  167.          Left            =   60
  168.          List            =   "frmTest.frx":0106
  169.          Style           =   2  'Dropdown List
  170.          TabIndex        =   4
  171.          Top             =   540
  172.          Width           =   2685
  173.       End
  174.       Begin VB.Label Label6 
  175.          AutoSize        =   -1  'True
  176.          Caption         =   "First day of week:"
  177.          Height          =   195
  178.          Left            =   60
  179.          TabIndex        =   14
  180.          Top             =   2220
  181.          Width           =   1305
  182.       End
  183.       Begin VB.Label Label4 
  184.          AutoSize        =   -1  'True
  185.          Caption         =   "Focus style:"
  186.          Height          =   195
  187.          Left            =   60
  188.          TabIndex        =   8
  189.          Top             =   1590
  190.          Width           =   870
  191.       End
  192.       Begin VB.Label Label3 
  193.          AutoSize        =   -1  'True
  194.          Caption         =   "Line style:"
  195.          Height          =   195
  196.          Left            =   60
  197.          TabIndex        =   6
  198.          Top             =   960
  199.          Width           =   735
  200.       End
  201.       Begin VB.Label Label2 
  202.          AutoSize        =   -1  'True
  203.          Caption         =   "Border style:"
  204.          Height          =   195
  205.          Left            =   60
  206.          TabIndex        =   3
  207.          Top             =   330
  208.          Width           =   930
  209.       End
  210.       Begin VB.Label Label1 
  211.          AutoSize        =   -1  'True
  212.          BackStyle       =   0  'Transparent
  213.          Caption         =   "Properties"
  214.          BeginProperty Font 
  215.             Name            =   "Tahoma"
  216.             Size            =   8.25
  217.             Charset         =   0
  218.             Weight          =   700
  219.             Underline       =   0   'False
  220.             Italic          =   0   'False
  221.             Strikethrough   =   0   'False
  222.          EndProperty
  223.          ForeColor       =   &H80000014&
  224.          Height          =   195
  225.          Left            =   45
  226.          TabIndex        =   2
  227.          Top             =   15
  228.          Width           =   885
  229.       End
  230.       Begin VB.Shape Shape1 
  231.          BorderStyle     =   0  'Transparent
  232.          FillColor       =   &H80000010&
  233.          FillStyle       =   0  'Solid
  234.          Height          =   255
  235.          Left            =   0
  236.          Top             =   0
  237.          Width           =   2805
  238.       End
  239.    End
  240.    Begin ucCalendarTest.ucCalendar ucCalendar1 
  241.       Height          =   2700
  242.       Left            =   150
  243.       TabIndex        =   0
  244.       Top             =   180
  245.       Width           =   3570
  246.       _ExtentX        =   6297
  247.       _ExtentY        =   4763
  248.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  249.          Name            =   "Tahoma"
  250.          Size            =   8.25
  251.          Charset         =   0
  252.          Weight          =   400
  253.          Underline       =   0   'False
  254.          Italic          =   0   'False
  255.          Strikethrough   =   0   'False
  256.       EndProperty
  257.       BeginProperty ActiveDayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  258.          Name            =   "Tahoma"
  259.          Size            =   8.25
  260.          Charset         =   0
  261.          Weight          =   700
  262.          Underline       =   0   'False
  263.          Italic          =   0   'False
  264.          Strikethrough   =   0   'False
  265.       EndProperty
  266.       BeginProperty MonthNameFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  267.          Name            =   "Tahoma"
  268.          Size            =   8.25
  269.          Charset         =   0
  270.          Weight          =   700
  271.          Underline       =   0   'False
  272.          Italic          =   0   'False
  273.          Strikethrough   =   0   'False
  274.       EndProperty
  275.       HeaderBackColor =   -2147483633
  276.       HeaderForeColor =   -2147483630
  277.       ShowWeekNumber  =   -1  'True
  278.    End
  279.    Begin VB.Label Label5 
  280.       Caption         =   "Label5"
  281.       Height          =   225
  282.       Left            =   150
  283.       TabIndex        =   9
  284.       Top             =   2970
  285.       Width           =   3525
  286.    End
  287. End
  288. Attribute VB_Name = "frmTest"
  289. Attribute VB_GlobalNameSpace = False
  290. Attribute VB_Creatable = False
  291. Attribute VB_PredeclaredId = True
  292. Attribute VB_Exposed = False
  293. Option Explicit
  294.  
  295. Private Declare Function LoadLibrary Lib "Kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
  296. Private Declare Function FreeLibrary Lib "Kernel32.dll" (ByVal hLibModule As Long) As Long
  297. Private Declare Sub InitCommonControls Lib "ComCtl32.dll" ()
  298.  
  299. Private hShellLib As Long
  300.  
  301. Private Sub Check1_Click()
  302.   ucCalendar1.ShowMonth = CBool(Check1.Value)
  303. End Sub
  304. Private Sub Check2_Click()
  305.   ucCalendar1.ShowWeekDays = CBool(Check2.Value)
  306. End Sub
  307. Private Sub Check3_Click()
  308.   ucCalendar1.MonthChangeButtons = CBool(Check3.Value)
  309. End Sub
  310. Private Sub Check5_Click()
  311.   ucCalendar1.ShowWeekNumber = CBool(Check5.Value)
  312. End Sub
  313.  
  314. Private Sub Combo1_Click()
  315.   ucCalendar1.BorderStyle = Combo1.ListIndex
  316. End Sub
  317. Private Sub Combo2_Click()
  318.   ucCalendar1.LineStyle = Combo2.ListIndex
  319. End Sub
  320. Private Sub Combo3_Click()
  321.   ucCalendar1.FocusStyle = Combo3.ListIndex
  322. End Sub
  323. Private Sub Combo4_Click()
  324.   ucCalendar1.FirstDayOfWeek = Combo4.ListIndex
  325. End Sub
  326.  
  327. Private Sub Command1_Click()
  328.   Call List1.Clear
  329. End Sub
  330.  
  331. Private Sub Form_Initialize()
  332.   hShellLib = LoadLibrary("Shell32.dll")
  333.   Call InitCommonControls
  334. End Sub
  335. Private Sub Form_Load()
  336.   Caption = "ucCalendar " & ucCalendar1.ControlVersion & " - Control Demonstration"
  337.   Combo1.ListIndex = ucCalendar1.BorderStyle
  338.   Combo2.ListIndex = ucCalendar1.LineStyle
  339.   Combo3.ListIndex = ucCalendar1.FocusStyle
  340.   Combo4.ListIndex = ucCalendar1.FirstDayOfWeek
  341.   Label5.Caption = Format(ucCalendar1.ActiveDate, "Long Date")
  342.   Call pvLogEvent("Welcome, using ucCalendar " & ucCalendar1.ControlVersion)
  343. End Sub
  344. Private Sub Form_Unload(Cancel As Integer)
  345.   Call FreeLibrary(hShellLib)
  346. End Sub
  347.  
  348. Private Sub pvLogEvent(ByVal sText As String)
  349.   If (Check4.Value = vbUnchecked) Then Exit Sub
  350.   Call List1.AddItem(sText)
  351.   List1.ListIndex = List1.ListCount - 1
  352. End Sub
  353.  
  354. Private Sub ucCalendar1_Change()
  355.   Label5.Caption = Format(ucCalendar1.ActiveDate, "Long Date")
  356.   Call pvLogEvent("Date changed to " & Format(ucCalendar1.ActiveDate, "Short Date"))
  357. End Sub
  358.