home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / dlgtest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-26  |  3.0 KB  |  92 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "Corporate Widget Tracker"
  4.    ClientHeight    =   930
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1530
  7.    ClientWidth     =   3840
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   1
  11.       weight          =   700
  12.       size            =   8.25
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    Height          =   1335
  18.    Left            =   1035
  19.    LinkTopic       =   "Form1"
  20.    ScaleHeight     =   930
  21.    ScaleWidth      =   3840
  22.    Top             =   1185
  23.    Width           =   3960
  24.    Begin VB.CommandButton cmdLogin 
  25.       Caption         =   "Display &Login Dialog"
  26.       BeginProperty Font 
  27.          name            =   "MS Sans Serif"
  28.          charset         =   1
  29.          weight          =   400
  30.          size            =   8.25
  31.          underline       =   0   'False
  32.          italic          =   0   'False
  33.          strikethrough   =   0   'False
  34.       EndProperty
  35.       Height          =   345
  36.       Left            =   225
  37.       TabIndex        =   0
  38.       Top             =   375
  39.       Width           =   2115
  40.    End
  41.    Begin VB.CommandButton cmdClose 
  42.       Caption         =   "&Close"
  43.       BeginProperty Font 
  44.          name            =   "MS Sans Serif"
  45.          charset         =   1
  46.          weight          =   400
  47.          size            =   8.25
  48.          underline       =   0   'False
  49.          italic          =   0   'False
  50.          strikethrough   =   0   'False
  51.       EndProperty
  52.       Height          =   345
  53.       Left            =   2475
  54.       TabIndex        =   1
  55.       Top             =   375
  56.       Width           =   1140
  57.    End
  58. Attribute VB_Name = "frmMain"
  59. Attribute VB_Creatable = False
  60. Attribute VB_Exposed = False
  61. Option Explicit
  62. Private Sub cmdClose_Click()
  63.     Unload Me
  64. End Sub
  65. Private Sub cmdLogin_Click()
  66.     Dim dlg As New StdLoginDialogs.SQLLoginDialog
  67.     Dim strResult As String
  68.     ' Because the variable 'dlg' was declared with
  69.     ' the New keyword, the SQLLoginDialog object
  70.     ' will be created when the following line of
  71.     ' code is executed.
  72.     strResult = dlg.Show(Me.Caption, "JoeUser", "CorpWidgetBase")
  73.     MsgBox "Your login string is: " & strResult
  74.     ' Destroy the object.
  75.     Set dlg = Nothing
  76. End Sub
  77. Sub Form_Load()
  78.     Dim dlg As StdLoginDialogs.SQLLoginDialog
  79.     Dim strResult As String
  80.     ' In contrast to the 'Dim dlg As New ...' syntax
  81.     ' used in the command button click event, here
  82.     ' the new SQLLoginDialog object is created by
  83.     ' using the New operator with the Set statement.
  84.     Set dlg = New StdLoginDialogs.SQLLoginDialog
  85.     ' In this case, the object already exists when
  86.     ' the following line of code is executed.
  87.     strResult = dlg.Show(Me.Caption, "JoeUser", "CorpWidgetBase")
  88.     MsgBox "Your login string is: " & strResult
  89.     ' Destroy the object.
  90.     Set dlg = Nothing
  91. End Sub
  92.