home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 October / Chip_2000-10_cd1.bin / zkuste / VBasic / Data / Utility / ezwiz11t.exe / %MAINDIR% / Samples / Data-Entry / frmPersonal.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-05-22  |  16.5 KB  |  454 lines

  1. VERSION 5.00
  2. Object = "{DD9A251C-F7DF-11D2-890D-00104BFF0B98}#1.0#0"; "EZWiz11.ocx"
  3. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
  4. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
  5. Begin VB.Form frmPersonal 
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Data-Gathering Wizard"
  8.    ClientHeight    =   4560
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   6975
  12.    Icon            =   "frmPersonal.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4560
  17.    ScaleWidth      =   6975
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   1  'CenterOwner
  20.    Begin EZLifeWizardControl.EZWizPage WizPages 
  21.       Height          =   3975
  22.       Index           =   2
  23.       Left            =   0
  24.       TabIndex        =   4
  25.       Tag             =   "Personal Details"
  26.       Top             =   0
  27.       Width           =   6975
  28.       _ExtentX        =   12303
  29.       _ExtentY        =   7011
  30.       Begin VB.TextBox txtTitle 
  31.          Height          =   285
  32.          Left            =   2760
  33.          TabIndex        =   8
  34.          Top             =   1560
  35.          Width           =   855
  36.       End
  37.       Begin VB.TextBox txtFirstname 
  38.          Height          =   285
  39.          Left            =   3720
  40.          TabIndex        =   10
  41.          Top             =   1560
  42.          Width           =   1335
  43.       End
  44.       Begin VB.TextBox txtLastname 
  45.          Height          =   285
  46.          Left            =   5160
  47.          TabIndex        =   12
  48.          Top             =   1560
  49.          Width           =   1575
  50.       End
  51.       Begin VB.ComboBox cboMaritalStatus 
  52.          Height          =   315
  53.          ItemData        =   "frmPersonal.frx":014A
  54.          Left            =   4800
  55.          List            =   "frmPersonal.frx":015D
  56.          Style           =   2  'Dropdown List
  57.          TabIndex        =   15
  58.          Top             =   2280
  59.          Width           =   1935
  60.       End
  61.       Begin MSComCtl2.DTPicker dtpDOB 
  62.          Height          =   375
  63.          Left            =   2760
  64.          TabIndex        =   14
  65.          Top             =   2280
  66.          Width           =   1815
  67.          _ExtentX        =   3201
  68.          _ExtentY        =   661
  69.          _Version        =   393216
  70.          CheckBox        =   -1  'True
  71.          CustomFormat    =   "d MMM yyyy"
  72.          DateIsNull      =   -1  'True
  73.          Format          =   22675459
  74.          CurrentDate     =   36336
  75.       End
  76.       Begin VB.PictureBox Picture2 
  77.          Height          =   3375
  78.          Left            =   240
  79.          Picture         =   "frmPersonal.frx":0187
  80.          ScaleHeight     =   3315
  81.          ScaleWidth      =   2235
  82.          TabIndex        =   6
  83.          Top             =   240
  84.          Width           =   2295
  85.       End
  86.       Begin VB.Label lblFirstname 
  87.          Caption         =   "&First Name *"
  88.          Height          =   255
  89.          Left            =   3720
  90.          TabIndex        =   9
  91.          Top             =   1320
  92.          Width           =   1215
  93.       End
  94.       Begin VB.Label lblTitle 
  95.          Caption         =   "&Title"
  96.          Height          =   255
  97.          Left            =   2760
  98.          TabIndex        =   7
  99.          Top             =   1320
  100.          Width           =   855
  101.       End
  102.       Begin VB.Label lblLastname 
  103.          Caption         =   "&Last Name *"
  104.          Height          =   255
  105.          Left            =   5160
  106.          TabIndex        =   11
  107.          Top             =   1320
  108.          Width           =   1575
  109.       End
  110.       Begin VB.Label lblDOB 
  111.          Caption         =   "&Date of Birth"
  112.          Height          =   255
  113.          Left            =   2760
  114.          TabIndex        =   13
  115.          Top             =   2040
  116.          Width           =   1575
  117.       End
  118.       Begin VB.Label lblMaritalStatus 
  119.          Caption         =   "&Marital Status"
  120.          Height          =   255
  121.          Left            =   4800
  122.          TabIndex        =   16
  123.          Top             =   2040
  124.          Width           =   1215
  125.       End
  126.       Begin VB.Label lblInstructions 
  127.          Caption         =   "Please enter the following details. Mandatory fields are marked with an asterisk (*)."
  128.          BeginProperty Font 
  129.             Name            =   "Arial"
  130.             Size            =   9.75
  131.             Charset         =   0
  132.             Weight          =   400
  133.             Underline       =   0   'False
  134.             Italic          =   0   'False
  135.             Strikethrough   =   0   'False
  136.          EndProperty
  137.          Height          =   855
  138.          Left            =   2760
  139.          TabIndex        =   5
  140.          Top             =   240
  141.          Width           =   3855
  142.       End
  143.    End
  144.    Begin EZLifeWizardControl.EZWizPage WizPages 
  145.       Height          =   3975
  146.       Index           =   4
  147.       Left            =   0
  148.       TabIndex        =   31
  149.       Tag             =   "Summary"
  150.       Top             =   0
  151.       Visible         =   0   'False
  152.       Width           =   6975
  153.       _ExtentX        =   12303
  154.       _ExtentY        =   7011
  155.       Begin SHDocVwCtl.WebBrowser html 
  156.          Height          =   3735
  157.          Left            =   120
  158.          TabIndex        =   32
  159.          TabStop         =   0   'False
  160.          Top             =   120
  161.          Width           =   6735
  162.          ExtentX         =   11880
  163.          ExtentY         =   6588
  164.          ViewMode        =   0
  165.          Offline         =   0
  166.          Silent          =   0
  167.          RegisterAsBrowser=   0
  168.          RegisterAsDropTarget=   0
  169.          AutoArrange     =   0   'False
  170.          NoClientEdge    =   0   'False
  171.          AlignLeft       =   0   'False
  172.          ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  173.          Location        =   ""
  174.       End
  175.    End
  176.    Begin EZLifeWizardControl.EZWizCtl EZWiz 
  177.       Align           =   2  'Align Bottom
  178.       Cancel          =   -1  'True
  179.       Default         =   -1  'True
  180.       Height          =   495
  181.       Left            =   0
  182.       TabIndex        =   33
  183.       Top             =   4065
  184.       Width           =   6975
  185.       _ExtentX        =   12303
  186.       _ExtentY        =   873
  187.       PageControl     =   "wizpages"
  188.       ActivePage      =   2
  189.    End
  190.    Begin EZLifeWizardControl.EZWizPage WizPages 
  191.       Height          =   3975
  192.       Index           =   3
  193.       Left            =   0
  194.       TabIndex        =   17
  195.       Tag             =   "Where You Live"
  196.       Top             =   0
  197.       Visible         =   0   'False
  198.       Width           =   6975
  199.       _ExtentX        =   12303
  200.       _ExtentY        =   7011
  201.       Begin VB.ComboBox cboStatus 
  202.          Height          =   315
  203.          ItemData        =   "frmPersonal.frx":19EF1
  204.          Left            =   3000
  205.          List            =   "frmPersonal.frx":19F01
  206.          Style           =   2  'Dropdown List
  207.          TabIndex        =   30
  208.          Top             =   3240
  209.          Width           =   2295
  210.       End
  211.       Begin VB.TextBox txtCountry 
  212.          Height          =   285
  213.          Left            =   3000
  214.          TabIndex        =   28
  215.          Top             =   2640
  216.          Width           =   1935
  217.       End
  218.       Begin VB.TextBox txtPostcode 
  219.          Height          =   285
  220.          Left            =   5040
  221.          TabIndex        =   26
  222.          Top             =   2040
  223.          Width           =   1215
  224.       End
  225.       Begin VB.TextBox txtCounty 
  226.          Height          =   285
  227.          Left            =   3000
  228.          TabIndex        =   24
  229.          Top             =   2040
  230.          Width           =   1935
  231.       End
  232.       Begin VB.TextBox txtTown 
  233.          Height          =   285
  234.          Left            =   3000
  235.          TabIndex        =   22
  236.          Top             =   1440
  237.          Width           =   1935
  238.       End
  239.       Begin VB.TextBox txtAddress 
  240.          Height          =   645
  241.          Left            =   3000
  242.          MultiLine       =   -1  'True
  243.          ScrollBars      =   2  'Vertical
  244.          TabIndex        =   20
  245.          Top             =   480
  246.          Width           =   3735
  247.       End
  248.       Begin VB.PictureBox Picture3 
  249.          Height          =   3495
  250.          Left            =   240
  251.          Picture         =   "frmPersonal.frx":19F2E
  252.          ScaleHeight     =   3435
  253.          ScaleWidth      =   2475
  254.          TabIndex        =   18
  255.          Top             =   240
  256.          Width           =   2535
  257.       End
  258.       Begin VB.Label lblStatus 
  259.          Caption         =   "Stat&us"
  260.          Height          =   255
  261.          Left            =   3000
  262.          TabIndex        =   29
  263.          Top             =   3000
  264.          Width           =   1935
  265.       End
  266.       Begin VB.Label lblCountry 
  267.          Caption         =   "Countr&y"
  268.          Height          =   255
  269.          Left            =   3000
  270.          TabIndex        =   27
  271.          Top             =   2400
  272.          Width           =   1935
  273.       End
  274.       Begin VB.Label lblPostcode 
  275.          Caption         =   "&Postal/Zip Code"
  276.          Height          =   255
  277.          Left            =   5040
  278.          TabIndex        =   25
  279.          Top             =   1800
  280.          Width           =   1455
  281.       End
  282.       Begin VB.Label lblCounty 
  283.          Caption         =   "&State/County/Province"
  284.          Height          =   255
  285.          Left            =   3000
  286.          TabIndex        =   23
  287.          Top             =   1800
  288.          Width           =   1935
  289.       End
  290.       Begin VB.Label lblTown 
  291.          Caption         =   "&Town/City"
  292.          Height          =   255
  293.          Left            =   3000
  294.          TabIndex        =   21
  295.          Top             =   1200
  296.          Width           =   1455
  297.       End
  298.       Begin VB.Label lblAddress 
  299.          Caption         =   "Street &Address"
  300.          Height          =   255
  301.          Left            =   3000
  302.          TabIndex        =   19
  303.          Top             =   240
  304.          Width           =   1695
  305.       End
  306.    End
  307.    Begin EZLifeWizardControl.EZWizPage WizPages 
  308.       Height          =   3975
  309.       Index           =   1
  310.       Left            =   0
  311.       TabIndex        =   0
  312.       Tag             =   "Introduction"
  313.       Top             =   0
  314.       Visible         =   0   'False
  315.       Width           =   6975
  316.       _ExtentX        =   12303
  317.       _ExtentY        =   7011
  318.       Begin VB.PictureBox Picture1 
  319.          Height          =   2895
  320.          Left            =   240
  321.          Picture         =   "frmPersonal.frx":3F6E0
  322.          ScaleHeight     =   2835
  323.          ScaleWidth      =   2595
  324.          TabIndex        =   3
  325.          Top             =   240
  326.          Width           =   2655
  327.       End
  328.       Begin VB.CheckBox chkSkipIntro 
  329.          Caption         =   "S&kip this page in future"
  330.          Height          =   255
  331.          Left            =   360
  332.          TabIndex        =   1
  333.          TabStop         =   0   'False
  334.          Top             =   3600
  335.          Width           =   2055
  336.       End
  337.       Begin VB.Label lblIntro 
  338.          Caption         =   $"frmPersonal.frx":423AC
  339.          BeginProperty Font 
  340.             Name            =   "Arial"
  341.             Size            =   9.75
  342.             Charset         =   0
  343.             Weight          =   400
  344.             Underline       =   0   'False
  345.             Italic          =   0   'False
  346.             Strikethrough   =   0   'False
  347.          EndProperty
  348.          Height          =   3135
  349.          Left            =   3120
  350.          TabIndex        =   2
  351.          Top             =   240
  352.          Width           =   3495
  353.       End
  354.    End
  355. Attribute VB_Name = "frmPersonal"
  356. Attribute VB_GlobalNameSpace = False
  357. Attribute VB_Creatable = False
  358. Attribute VB_PredeclaredId = True
  359. Attribute VB_Exposed = False
  360. Option Explicit
  361. Option Compare Text
  362. ' This demo program shows how you can use the various features of the EZLife Wizard
  363. ' Control. Examine the code carefully to learn the various techniques you can use
  364. ' to build all kinds of wizards.
  365. Private mstrBaseCaption As String   ' Holds the initial form caption
  366. Private mblnFinished As Boolean     ' Indicates whether wizard was Finished or Cancelled
  367. Private Sub chkSkipIntro_Click()
  368.     ' Save the user's "Skip First Page" preference
  369.     SaveSetting App.Title, "Settings", "Skip" & mstrBaseCaption & "Intro", chkSkipIntro
  370. End Sub
  371. Private Sub EZWiz_AfterNext()
  372.     ' You can perform additional processing after each page here...
  373.     Select Case EZWiz.ActivePage
  374.         Case 1
  375.             ' Post-page processing
  376.             
  377.         Case 2
  378.         
  379.         Case 3
  380.         
  381.         Case 4
  382.     End Select
  383. End Sub
  384. Private Sub EZWiz_BeforeNext(Cancel As stdole.OLE_CANCELBOOL)
  385.     ' Put page-level validation code here
  386.     Dim strMsg As String
  387.     Select Case EZWiz.ActivePage
  388.         Case 1
  389.             
  390.         Case 2
  391.             EZWiz.Enough = False    ' Assume we don't have enough data to finish process
  392.             
  393.             If txtFirstname = vbNullString Then
  394.                 strMsg = "You must supply a first name."
  395.                 txtFirstname.SetFocus
  396.             ElseIf txtLastname = vbNullString Then
  397.                 strMsg = "You must supply a last name."
  398.                 txtLastname.SetFocus
  399.             ElseIf (Not IsNull(dtpDOB)) And dtpDOB > Date Then
  400.                 strMsg = "Date of birth must be in the past."
  401.                 dtpDOB.SetFocus
  402.             Else
  403.                 EZWiz.Enough = True ' If everything is valid on this page, we have enough data for the whole wizard process
  404.             End If
  405.         
  406.         Case 3
  407.             ShowSummary
  408.     End Select
  409.     ' Report any error & cancel the page change
  410.     If strMsg <> vbNullString Then
  411.         MsgBox strMsg, vbExclamation, mstrBaseCaption
  412.         Cancel = True
  413.     End If
  414. End Sub
  415. Private Sub EZWiz_Cancelled()
  416.     Unload Me   ' Try to unload the form
  417. End Sub
  418. Private Sub EZWiz_Finished()
  419.     ' Put final processing code here...
  420.     mblnFinished = True ' Indicate that there should be no close confirmation on QueryUnload
  421.     Unload Me
  422. End Sub
  423. Private Sub EZWiz_Init()
  424.     ' Get the "Skip First Page" setting from registry
  425.     chkSkipIntro = GetSetting(App.Title, "Settings", "Skip" & mstrBaseCaption & "Intro", 0)
  426.     ' Set start page accordingly
  427.     If chkSkipIntro = 1 Then EZWiz.StartPage = 2
  428.     EZWiz_PageChanged   ' Make sure form caption changes on Load
  429. End Sub
  430. Private Sub EZWiz_PageChanged()
  431.     ' Change the form caption to reflect the current step
  432.     Caption = mstrBaseCaption & " - " & WizPages(EZWiz.ActivePage).Tag & " - Page " & EZWiz.ActivePage & " of " & EZWiz.LastPage
  433. End Sub
  434. Private Sub Form_Load()
  435.     ' Save the initial form caption set at design time
  436.     mstrBaseCaption = Caption
  437. End Sub
  438. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  439.     ' Confirm with the user whether to unload form
  440.     If Not mblnFinished Then
  441.         Cancel = (MsgBox("This will cancel the wizard. Continue?", vbYesNo + vbQuestion, mstrBaseCaption) = vbNo)
  442.     End If
  443. End Sub
  444. Private Sub ShowSummary()
  445.     Dim strSummary As String, strFullAddress As String
  446.     Const HTMLDOCHEADER = "<html><head><style>body {background-color: #ffffcc; font-family: arial; font-size: 9pt; }</style></head><body>"
  447.     Const HTMLDOCFOOTER = "</body></html>"
  448.     strFullAddress = IIf(txtAddress = vbNullString, vbNullString, txtAddress & ", ") & IIf(txtTown = vbNullString, vbNullString, txtTown & ", ") & IIf(txtCounty = vbNullString, vbNullString, txtCounty & ", ") & IIf(txtPostcode = vbNullString, vbNullString, txtPostcode & ", ") & IIf(txtCountry = vbNullString, vbNullString, txtCountry & ", ")
  449.     strSummary = HTMLDOCHEADER & "<h3>Thank you.</h3><p>You have now entered all the information required. A summary of your details is shown below - to confirm these details and save them, press the Finish button.</p><p>You are " & txtFirstname & " " & txtLastname & IIf(IsNull(dtpDOB), vbNullString, ", born on " & Format(dtpDOB, "dddd, d mmmm, yyyy")) & ". "
  450.     If strFullAddress <> vbNullString Then strSummary = strSummary & "You live at " & Left(strFullAddress, Len(strFullAddress) - 2) & IIf(cboStatus.Text = vbNullString, vbNullString, ", which is " & cboStatus.Text) & "."
  451.     strSummary = strSummary & "</p>" & HTMLDOCFOOTER
  452.     html.Navigate "about:" & strSummary
  453. End Sub
  454.