home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / MyCalendar2152455152009.psc / Form2.frm < prev    next >
Text File  |  2009-04-27  |  12KB  |  437 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "MyCalendar"
  4.    ClientHeight    =   5880
  5.    ClientLeft      =   60
  6.    ClientTop       =   450
  7.    ClientWidth     =   8115
  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     =   5880
  19.    ScaleWidth      =   8115
  20.    StartUpPosition =   2  'CenterScreen
  21.    Begin VB.CommandButton cmdHighlight 
  22.       Caption         =   "Highlight"
  23.       Height          =   375
  24.       Left            =   5040
  25.       TabIndex        =   25
  26.       Top             =   4920
  27.       Width           =   1335
  28.    End
  29.    Begin VB.TextBox txtHighlight 
  30.       Height          =   315
  31.       Left            =   3600
  32.       TabIndex        =   24
  33.       Top             =   4920
  34.       Width           =   1335
  35.    End
  36.    Begin VB.CommandButton cmdAddHoliday 
  37.       Caption         =   "Add Holiday"
  38.       Height          =   375
  39.       Left            =   5040
  40.       TabIndex        =   23
  41.       Top             =   4560
  42.       Width           =   1335
  43.    End
  44.    Begin VB.TextBox txtHoliday 
  45.       Height          =   315
  46.       Left            =   3600
  47.       TabIndex        =   22
  48.       Top             =   4560
  49.       Width           =   1335
  50.    End
  51.    Begin VB.CommandButton cmdReset 
  52.       Caption         =   "Reset"
  53.       Height          =   375
  54.       Left            =   3600
  55.       TabIndex        =   21
  56.       Top             =   4080
  57.       Width           =   1335
  58.    End
  59.    Begin VB.PictureBox Picture9 
  60.       BackColor       =   &H00800080&
  61.       Height          =   255
  62.       Left            =   6480
  63.       ScaleHeight     =   195
  64.       ScaleWidth      =   315
  65.       TabIndex        =   20
  66.       Top             =   3720
  67.       Width           =   375
  68.    End
  69.    Begin VB.PictureBox Picture8 
  70.       BackColor       =   &H0000FF00&
  71.       Height          =   255
  72.       Left            =   6000
  73.       ScaleHeight     =   195
  74.       ScaleWidth      =   315
  75.       TabIndex        =   19
  76.       Top             =   3720
  77.       Width           =   375
  78.    End
  79.    Begin VB.PictureBox Picture7 
  80.       BackColor       =   &H00C0C0FF&
  81.       Height          =   255
  82.       Left            =   5520
  83.       ScaleHeight     =   195
  84.       ScaleWidth      =   315
  85.       TabIndex        =   18
  86.       Top             =   3720
  87.       Width           =   375
  88.    End
  89.    Begin VB.PictureBox Picture6 
  90.       BackColor       =   &H00FF00FF&
  91.       Height          =   255
  92.       Left            =   6480
  93.       ScaleHeight     =   195
  94.       ScaleWidth      =   315
  95.       TabIndex        =   16
  96.       Top             =   3360
  97.       Width           =   375
  98.    End
  99.    Begin VB.PictureBox Picture5 
  100.       BackColor       =   &H00FFFF00&
  101.       Height          =   255
  102.       Left            =   6000
  103.       ScaleHeight     =   195
  104.       ScaleWidth      =   315
  105.       TabIndex        =   15
  106.       Top             =   3360
  107.       Width           =   375
  108.    End
  109.    Begin VB.PictureBox Picture4 
  110.       BackColor       =   &H0000FFFF&
  111.       Height          =   255
  112.       Left            =   5520
  113.       ScaleHeight     =   195
  114.       ScaleWidth      =   315
  115.       TabIndex        =   14
  116.       Top             =   3360
  117.       Width           =   375
  118.    End
  119.    Begin VB.PictureBox Picture3 
  120.       BackColor       =   &H0000C000&
  121.       Height          =   255
  122.       Left            =   6480
  123.       ScaleHeight     =   195
  124.       ScaleWidth      =   315
  125.       TabIndex        =   12
  126.       Top             =   3000
  127.       Width           =   375
  128.    End
  129.    Begin VB.PictureBox Picture2 
  130.       BackColor       =   &H00FF0000&
  131.       Height          =   255
  132.       Left            =   6000
  133.       ScaleHeight     =   195
  134.       ScaleWidth      =   315
  135.       TabIndex        =   11
  136.       Top             =   3000
  137.       Width           =   375
  138.    End
  139.    Begin VB.PictureBox Picture1 
  140.       BackColor       =   &H000000FF&
  141.       Height          =   255
  142.       Left            =   5520
  143.       ScaleHeight     =   195
  144.       ScaleWidth      =   315
  145.       TabIndex        =   10
  146.       Top             =   3000
  147.       Width           =   375
  148.    End
  149.    Begin VB.ComboBox cboHeaderFormat 
  150.       Height          =   315
  151.       ItemData        =   "Form2.frx":0000
  152.       Left            =   3600
  153.       List            =   "Form2.frx":000D
  154.       Style           =   2  'Dropdown List
  155.       TabIndex        =   7
  156.       Top             =   2520
  157.       Width           =   1815
  158.    End
  159.    Begin VB.CheckBox chkHeaderBold 
  160.       Caption         =   "Header Bold (Toggle)"
  161.       Height          =   255
  162.       Left            =   3600
  163.       TabIndex        =   6
  164.       Top             =   1920
  165.       Width           =   3735
  166.    End
  167.    Begin VB.CheckBox chkMonthBold 
  168.       Caption         =   "Month Bold (Toggle)"
  169.       Height          =   255
  170.       Left            =   3600
  171.       TabIndex        =   5
  172.       Top             =   1560
  173.       Width           =   3735
  174.    End
  175.    Begin VB.CheckBox chkDateBold 
  176.       Caption         =   "Current Date Bold (Toggle)"
  177.       Height          =   255
  178.       Left            =   3600
  179.       TabIndex        =   4
  180.       Top             =   1200
  181.       Width           =   3735
  182.    End
  183.    Begin VB.CheckBox chkBorder 
  184.       Caption         =   "Border (Toggle)"
  185.       Height          =   255
  186.       Left            =   3600
  187.       TabIndex        =   3
  188.       Top             =   840
  189.       Width           =   1935
  190.    End
  191.    Begin VB.CheckBox chkSunday 
  192.       Caption         =   "Sunday is a working day"
  193.       Height          =   495
  194.       Left            =   3600
  195.       TabIndex        =   2
  196.       Top             =   360
  197.       Width           =   3375
  198.    End
  199.    Begin VB.CheckBox chkSaturday 
  200.       Caption         =   "Saturday is a working day"
  201.       Height          =   495
  202.       Left            =   3600
  203.       TabIndex        =   1
  204.       Top             =   0
  205.       Width           =   3375
  206.    End
  207.    Begin Project1.MyCalendar MyCalendar 
  208.       Height          =   3000
  209.       Left            =   120
  210.       TabIndex        =   0
  211.       Top             =   120
  212.       Width           =   3285
  213.       _ExtentX        =   5794
  214.       _ExtentY        =   5292
  215.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  216.          Name            =   "Tahoma"
  217.          Size            =   8.25
  218.          Charset         =   0
  219.          Weight          =   400
  220.          Underline       =   0   'False
  221.          Italic          =   0   'False
  222.          Strikethrough   =   0   'False
  223.       EndProperty
  224.    End
  225.    Begin VB.Label Label4 
  226.       AutoSize        =   -1  'True
  227.       BackStyle       =   0  'Transparent
  228.       Caption         =   "Back Color"
  229.       Height          =   195
  230.       Left            =   3600
  231.       TabIndex        =   17
  232.       Top             =   3720
  233.       Width           =   750
  234.    End
  235.    Begin VB.Label Label3 
  236.       AutoSize        =   -1  'True
  237.       BackStyle       =   0  'Transparent
  238.       Caption         =   "Working Day Color"
  239.       Height          =   195
  240.       Left            =   3600
  241.       TabIndex        =   13
  242.       Top             =   3360
  243.       Width           =   1335
  244.    End
  245.    Begin VB.Label Label2 
  246.       AutoSize        =   -1  'True
  247.       BackStyle       =   0  'Transparent
  248.       Caption         =   "Non Working Day Color"
  249.       Height          =   195
  250.       Left            =   3600
  251.       TabIndex        =   9
  252.       Top             =   3000
  253.       Width           =   1665
  254.    End
  255.    Begin VB.Label Label1 
  256.       AutoSize        =   -1  'True
  257.       BackStyle       =   0  'Transparent
  258.       Caption         =   "Format"
  259.       Height          =   195
  260.       Left            =   3600
  261.       TabIndex        =   8
  262.       Top             =   2280
  263.       Width           =   510
  264.    End
  265. End
  266. Attribute VB_Name = "Form1"
  267. Attribute VB_GlobalNameSpace = False
  268. Attribute VB_Creatable = False
  269. Attribute VB_PredeclaredId = True
  270. Attribute VB_Exposed = False
  271. Option Explicit
  272.  
  273. Private Sub cboHeaderFormat_Click()
  274.     On Error Resume Next
  275.     MyCalendar.HeaderFormat = cboHeaderFormat.ListIndex
  276.     Err.Clear
  277. End Sub
  278.  
  279. Private Sub chkAppearance_Click()
  280.     On Error Resume Next
  281.     MyCalendar.Appearance = chkBorder.Value
  282.     Err.Clear
  283. End Sub
  284.  
  285. Private Sub chkBorder_Click()
  286.     On Error Resume Next
  287.     MyCalendar.BorderStyle = chkBorder.Value
  288.     Err.Clear
  289. End Sub
  290.  
  291. Private Sub chkDateBold_Click()
  292.     On Error Resume Next
  293.     MyCalendar.CurrentDateBold = IIf(chkDateBold.Value = 1, True, False)
  294.     Err.Clear
  295. End Sub
  296.  
  297. Private Sub chkHeaderBold_Click()
  298.     On Error Resume Next
  299.     MyCalendar.HeaderBold = IIf(chkHeaderBold.Value = 1, True, False)
  300.     Err.Clear
  301. End Sub
  302.  
  303. Private Sub chkMonthBold_Click()
  304.     On Error Resume Next
  305.     MyCalendar.MonthBold = IIf(chkMonthBold.Value = 1, True, False)
  306.     Err.Clear
  307. End Sub
  308.  
  309. Private Sub chkSaturday_Click()
  310.     On Error Resume Next
  311.     MyCalendar.SaturdayIsAWorkingDay = IIf(chkSaturday.Value = 1, True, False)
  312.     Err.Clear
  313. End Sub
  314.  
  315. Private Sub chkSunday_Click()
  316.     On Error Resume Next
  317.     MyCalendar.SundayIsAWorkingDay = IIf(chkSunday.Value = 1, True, False)
  318.     Err.Clear
  319. End Sub
  320.  
  321. Private Sub cmdAddHoliday_Click()
  322.     On Error Resume Next
  323.     If Len(txtHoliday.Text) = 0 Then
  324.         MsgBox "Please specify the date to add as a holiday.", , "Holiday Error"
  325.         Err.Clear
  326.         Exit Sub
  327.     End If
  328.     
  329.     If IsDate(txtHoliday.Text) = False Then
  330.         MsgBox "The specified value '" & txtHoliday.Text & "' is not a valid date.", , "Holiday Error"
  331.         Err.Clear
  332.         Exit Sub
  333.     End If
  334.     
  335.     MyCalendar.AddHoliday txtHoliday.Text
  336.     Err.Clear
  337. End Sub
  338.  
  339. Private Sub cmdHighlight_Click()
  340.     On Error Resume Next
  341.     If Len(txtHighlight.Text) = 0 Then
  342.         MsgBox "Please specify the date to highlight.", , "Highlight Error"
  343.         Err.Clear
  344.         Exit Sub
  345.     End If
  346.     
  347.     If IsDate(txtHighlight.Text) = False Then
  348.         MsgBox "The specified value '" & txtHighlight.Text & "' is not a valid date.", , "Highlight Error"
  349.         Err.Clear
  350.         Exit Sub
  351.     End If
  352.     
  353.     MyCalendar.AddHighlight txtHighlight.Text
  354.     Err.Clear
  355. End Sub
  356.  
  357. Private Sub cmdReset_Click()
  358.     On Error Resume Next
  359.     MyCalendar.Reset
  360.     Err.Clear
  361. End Sub
  362.  
  363. Private Sub Form_Load()
  364.     On Error Resume Next
  365.     txtHoliday.Text = Format$(DateAdd("d", 2, Now), "dd/mm/yyyy")
  366.     txtHighlight.Text = Format$(DateAdd("d", -5, Now), "dd/mm/yyyy")
  367.     
  368.     MyCalendar.AddHighlight Format$(DateAdd("d", -3, Now), "dd/mm/yyyy")
  369.     MyCalendar.AddHighlight Format$(DateAdd("d", -1, Now), "dd/mm/yyyy")
  370.     MyCalendar.AddHoliday Format$(DateAdd("d", 3, Now), "dd/mm/yyyy")
  371.     Err.Clear
  372. End Sub
  373.  
  374. Private Sub MyCalendar_DayClick()
  375.     On Error Resume Next
  376.     Caption = "MyCalendar: " & MyCalendar.CurrentDate
  377.     Err.Clear
  378. End Sub
  379.  
  380. Private Sub Picture1_Click()
  381.     On Error Resume Next
  382.     MyCalendar.NonWorkingBackColor = Picture1.BackColor
  383.     Err.Clear
  384. End Sub
  385.  
  386. Private Sub Picture2_Click()
  387.     On Error Resume Next
  388.     MyCalendar.NonWorkingBackColor = Picture2.BackColor
  389.     Err.Clear
  390. End Sub
  391.  
  392. Private Sub Picture3_Click()
  393.     On Error Resume Next
  394.     MyCalendar.NonWorkingBackColor = Picture3.BackColor
  395.     Err.Clear
  396. End Sub
  397.  
  398. Private Sub Picture4_Click()
  399.     On Error Resume Next
  400.     MyCalendar.CurrentDateBackColor = Picture4.BackColor
  401.     Err.Clear
  402. End Sub
  403.  
  404. Private Sub Picture5_Click()
  405.     On Error Resume Next
  406.     MyCalendar.CurrentDateBackColor = Picture5.BackColor
  407.     
  408.     Err.Clear
  409. End Sub
  410.  
  411. Private Sub Picture6_Click()
  412.     On Error Resume Next
  413.     MyCalendar.CurrentDateBackColor = Picture6.BackColor
  414.     
  415.     Err.Clear
  416. End Sub
  417.  
  418. Private Sub Picture7_Click()
  419.     On Error Resume Next
  420.     MyCalendar.BackColor = Picture7.BackColor
  421.     Err.Clear
  422. End Sub
  423.  
  424. Private Sub Picture8_Click()
  425.     On Error Resume Next
  426.     MyCalendar.BackColor = Picture8.BackColor
  427.     
  428.     Err.Clear
  429. End Sub
  430.  
  431. Private Sub Picture9_Click()
  432.     On Error Resume Next
  433.     MyCalendar.BackColor = Picture9.BackColor
  434.     
  435.     Err.Clear
  436. End Sub
  437.