home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap38 / frmdia~1.frm next >
Text File  |  1995-09-11  |  2KB  |  90 lines

  1. VERSION 4.00
  2. Begin VB.Form frmDialogs 
  3.    Caption         =   "Connection Dialog Boxes"
  4.    ClientHeight    =   1695
  5.    ClientLeft      =   2145
  6.    ClientTop       =   2280
  7.    ClientWidth     =   5505
  8.    Height          =   2100
  9.    Left            =   2085
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1695
  12.    ScaleWidth      =   5505
  13.    Top             =   1935
  14.    Width           =   5625
  15.    Begin VB.Frame Frame1 
  16.       Caption         =   "Select Resource"
  17.       Height          =   1335
  18.       Left            =   3240
  19.       TabIndex        =   2
  20.       Top             =   120
  21.       Width           =   1935
  22.       Begin VB.OptionButton optPrinter 
  23.          Caption         =   "Printer Resource"
  24.          Height          =   375
  25.          Left            =   240
  26.          TabIndex        =   4
  27.          Top             =   840
  28.          Width           =   1575
  29.       End
  30.       Begin VB.OptionButton optDisk 
  31.          Caption         =   "Disk Resource"
  32.          Height          =   195
  33.          Left            =   240
  34.          TabIndex        =   3
  35.          Top             =   360
  36.          Value           =   -1  'True
  37.          Width           =   1455
  38.       End
  39.    End
  40.    Begin VB.CommandButton cmdDisconnectDialog 
  41.       Caption         =   "Open &Disconnect Dialog"
  42.       Height          =   495
  43.       Left            =   360
  44.       TabIndex        =   1
  45.       Top             =   960
  46.       Width           =   2535
  47.    End
  48.    Begin VB.CommandButton cmdConnectDialog 
  49.       Caption         =   "Open &Connect Dialog"
  50.       Height          =   495
  51.       Left            =   360
  52.       TabIndex        =   0
  53.       Top             =   240
  54.       Width           =   2535
  55.    End
  56. End
  57. Attribute VB_Name = "frmDialogs"
  58. Attribute VB_Creatable = False
  59. Attribute VB_Exposed = False
  60. Private Sub cmdConnectDialog_Click()
  61. Dim Succeed As Long
  62. Dim Resource As Long
  63.  
  64. If optDisk Then
  65.    Resource = RESOURCETYPE_DISK
  66.    Else
  67.    Resource = RESOURCETYPE_PRINT
  68. End If
  69.  
  70. Succeed = WNetConnectionDialog(hwnd, Resource)
  71.  
  72. End Sub
  73.  
  74.  
  75. Private Sub cmdDisconnectDialog_Click()
  76. Dim Succeed As Long
  77. Dim Resource As Long
  78.  
  79. If optDisk Then
  80.    Resource = RESOURCETYPE_DISK
  81.    Else
  82.    Resource = RESOURCETYPE_PRINT
  83. End If
  84.  
  85. Succeed = WNetDisconnectDialog(hwnd, Resource)
  86.  
  87. End Sub
  88.  
  89.  
  90.