home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Object = "{DD9A251C-F7DF-11D2-890D-00104BFF0B98}#1.0#0"; "EZWiz11.ocx" Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll" Begin VB.Form frmPersonal BorderStyle = 3 'Fixed Dialog Caption = "Data-Gathering Wizard" ClientHeight = 4560 ClientLeft = 45 ClientTop = 330 ClientWidth = 6975 Icon = "frmPersonal.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 4560 ScaleWidth = 6975 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin EZLifeWizardControl.EZWizPage WizPages Height = 3975 Index = 2 Left = 0 TabIndex = 4 Tag = "Personal Details" Top = 0 Width = 6975 _ExtentX = 12303 _ExtentY = 7011 Begin VB.TextBox txtTitle Height = 285 Left = 2760 TabIndex = 8 Top = 1560 Width = 855 End Begin VB.TextBox txtFirstname Height = 285 Left = 3720 TabIndex = 10 Top = 1560 Width = 1335 End Begin VB.TextBox txtLastname Height = 285 Left = 5160 TabIndex = 12 Top = 1560 Width = 1575 End Begin VB.ComboBox cboMaritalStatus Height = 315 ItemData = "frmPersonal.frx":014A Left = 4800 List = "frmPersonal.frx":015D Style = 2 'Dropdown List TabIndex = 15 Top = 2280 Width = 1935 End Begin MSComCtl2.DTPicker dtpDOB Height = 375 Left = 2760 TabIndex = 14 Top = 2280 Width = 1815 _ExtentX = 3201 _ExtentY = 661 _Version = 393216 CheckBox = -1 'True CustomFormat = "d MMM yyyy" DateIsNull = -1 'True Format = 22675459 CurrentDate = 36336 End Begin VB.PictureBox Picture2 Height = 3375 Left = 240 Picture = "frmPersonal.frx":0187 ScaleHeight = 3315 ScaleWidth = 2235 TabIndex = 6 Top = 240 Width = 2295 End Begin VB.Label lblFirstname Caption = "&First Name *" Height = 255 Left = 3720 TabIndex = 9 Top = 1320 Width = 1215 End Begin VB.Label lblTitle Caption = "&Title" Height = 255 Left = 2760 TabIndex = 7 Top = 1320 Width = 855 End Begin VB.Label lblLastname Caption = "&Last Name *" Height = 255 Left = 5160 TabIndex = 11 Top = 1320 Width = 1575 End Begin VB.Label lblDOB Caption = "&Date of Birth" Height = 255 Left = 2760 TabIndex = 13 Top = 2040 Width = 1575 End Begin VB.Label lblMaritalStatus Caption = "&Marital Status" Height = 255 Left = 4800 TabIndex = 16 Top = 2040 Width = 1215 End Begin VB.Label lblInstructions Caption = "Please enter the following details. Mandatory fields are marked with an asterisk (*)." BeginProperty Font Name = "Arial" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 855 Left = 2760 TabIndex = 5 Top = 240 Width = 3855 End End Begin EZLifeWizardControl.EZWizPage WizPages Height = 3975 Index = 4 Left = 0 TabIndex = 31 Tag = "Summary" Top = 0 Visible = 0 'False Width = 6975 _ExtentX = 12303 _ExtentY = 7011 Begin SHDocVwCtl.WebBrowser html Height = 3735 Left = 120 TabIndex = 32 TabStop = 0 'False Top = 120 Width = 6735 ExtentX = 11880 ExtentY = 6588 ViewMode = 0 Offline = 0 Silent = 0 RegisterAsBrowser= 0 RegisterAsDropTarget= 0 AutoArrange = 0 'False NoClientEdge = 0 'False AlignLeft = 0 'False ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}" Location = "" End End Begin EZLifeWizardControl.EZWizCtl EZWiz Align = 2 'Align Bottom Cancel = -1 'True Default = -1 'True Height = 495 Left = 0 TabIndex = 33 Top = 4065 Width = 6975 _ExtentX = 12303 _ExtentY = 873 PageControl = "wizpages" ActivePage = 2 End Begin EZLifeWizardControl.EZWizPage WizPages Height = 3975 Index = 3 Left = 0 TabIndex = 17 Tag = "Where You Live" Top = 0 Visible = 0 'False Width = 6975 _ExtentX = 12303 _ExtentY = 7011 Begin VB.ComboBox cboStatus Height = 315 ItemData = "frmPersonal.frx":19EF1 Left = 3000 List = "frmPersonal.frx":19F01 Style = 2 'Dropdown List TabIndex = 30 Top = 3240 Width = 2295 End Begin VB.TextBox txtCountry Height = 285 Left = 3000 TabIndex = 28 Top = 2640 Width = 1935 End Begin VB.TextBox txtPostcode Height = 285 Left = 5040 TabIndex = 26 Top = 2040 Width = 1215 End Begin VB.TextBox txtCounty Height = 285 Left = 3000 TabIndex = 24 Top = 2040 Width = 1935 End Begin VB.TextBox txtTown Height = 285 Left = 3000 TabIndex = 22 Top = 1440 Width = 1935 End Begin VB.TextBox txtAddress Height = 645 Left = 3000 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 20 Top = 480 Width = 3735 End Begin VB.PictureBox Picture3 Height = 3495 Left = 240 Picture = "frmPersonal.frx":19F2E ScaleHeight = 3435 ScaleWidth = 2475 TabIndex = 18 Top = 240 Width = 2535 End Begin VB.Label lblStatus Caption = "Stat&us" Height = 255 Left = 3000 TabIndex = 29 Top = 3000 Width = 1935 End Begin VB.Label lblCountry Caption = "Countr&y" Height = 255 Left = 3000 TabIndex = 27 Top = 2400 Width = 1935 End Begin VB.Label lblPostcode Caption = "&Postal/Zip Code" Height = 255 Left = 5040 TabIndex = 25 Top = 1800 Width = 1455 End Begin VB.Label lblCounty Caption = "&State/County/Province" Height = 255 Left = 3000 TabIndex = 23 Top = 1800 Width = 1935 End Begin VB.Label lblTown Caption = "&Town/City" Height = 255 Left = 3000 TabIndex = 21 Top = 1200 Width = 1455 End Begin VB.Label lblAddress Caption = "Street &Address" Height = 255 Left = 3000 TabIndex = 19 Top = 240 Width = 1695 End End Begin EZLifeWizardControl.EZWizPage WizPages Height = 3975 Index = 1 Left = 0 TabIndex = 0 Tag = "Introduction" Top = 0 Visible = 0 'False Width = 6975 _ExtentX = 12303 _ExtentY = 7011 Begin VB.PictureBox Picture1 Height = 2895 Left = 240 Picture = "frmPersonal.frx":3F6E0 ScaleHeight = 2835 ScaleWidth = 2595 TabIndex = 3 Top = 240 Width = 2655 End Begin VB.CheckBox chkSkipIntro Caption = "S&kip this page in future" Height = 255 Left = 360 TabIndex = 1 TabStop = 0 'False Top = 3600 Width = 2055 End Begin VB.Label lblIntro Caption = $"frmPersonal.frx":423AC BeginProperty Font Name = "Arial" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 3135 Left = 3120 TabIndex = 2 Top = 240 Width = 3495 End End Attribute VB_Name = "frmPersonal" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Option Compare Text ' This demo program shows how you can use the various features of the EZLife Wizard ' Control. Examine the code carefully to learn the various techniques you can use ' to build all kinds of wizards. Private mstrBaseCaption As String ' Holds the initial form caption Private mblnFinished As Boolean ' Indicates whether wizard was Finished or Cancelled Private Sub chkSkipIntro_Click() ' Save the user's "Skip First Page" preference SaveSetting App.Title, "Settings", "Skip" & mstrBaseCaption & "Intro", chkSkipIntro End Sub Private Sub EZWiz_AfterNext() ' You can perform additional processing after each page here... Select Case EZWiz.ActivePage Case 1 ' Post-page processing Case 2 Case 3 Case 4 End Select End Sub Private Sub EZWiz_BeforeNext(Cancel As stdole.OLE_CANCELBOOL) ' Put page-level validation code here Dim strMsg As String Select Case EZWiz.ActivePage Case 1 Case 2 EZWiz.Enough = False ' Assume we don't have enough data to finish process If txtFirstname = vbNullString Then strMsg = "You must supply a first name." txtFirstname.SetFocus ElseIf txtLastname = vbNullString Then strMsg = "You must supply a last name." txtLastname.SetFocus ElseIf (Not IsNull(dtpDOB)) And dtpDOB > Date Then strMsg = "Date of birth must be in the past." dtpDOB.SetFocus Else EZWiz.Enough = True ' If everything is valid on this page, we have enough data for the whole wizard process End If Case 3 ShowSummary End Select ' Report any error & cancel the page change If strMsg <> vbNullString Then MsgBox strMsg, vbExclamation, mstrBaseCaption Cancel = True End If End Sub Private Sub EZWiz_Cancelled() Unload Me ' Try to unload the form End Sub Private Sub EZWiz_Finished() ' Put final processing code here... mblnFinished = True ' Indicate that there should be no close confirmation on QueryUnload Unload Me End Sub Private Sub EZWiz_Init() ' Get the "Skip First Page" setting from registry chkSkipIntro = GetSetting(App.Title, "Settings", "Skip" & mstrBaseCaption & "Intro", 0) ' Set start page accordingly If chkSkipIntro = 1 Then EZWiz.StartPage = 2 EZWiz_PageChanged ' Make sure form caption changes on Load End Sub Private Sub EZWiz_PageChanged() ' Change the form caption to reflect the current step Caption = mstrBaseCaption & " - " & WizPages(EZWiz.ActivePage).Tag & " - Page " & EZWiz.ActivePage & " of " & EZWiz.LastPage End Sub Private Sub Form_Load() ' Save the initial form caption set at design time mstrBaseCaption = Caption End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) ' Confirm with the user whether to unload form If Not mblnFinished Then Cancel = (MsgBox("This will cancel the wizard. Continue?", vbYesNo + vbQuestion, mstrBaseCaption) = vbNo) End If End Sub Private Sub ShowSummary() Dim strSummary As String, strFullAddress As String Const HTMLDOCHEADER = "<html><head><style>body {background-color: #ffffcc; font-family: arial; font-size: 9pt; }</style></head><body>" Const HTMLDOCFOOTER = "</body></html>" 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 & ", ") 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")) & ". " If strFullAddress <> vbNullString Then strSummary = strSummary & "You live at " & Left(strFullAddress, Len(strFullAddress) - 2) & IIf(cboStatus.Text = vbNullString, vbNullString, ", which is " & cboStatus.Text) & "." strSummary = strSummary & "</p>" & HTMLDOCFOOTER html.Navigate "about:" & strSummary End Sub