home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 6 / Eagles_Nest_Mac_Collection_Disc_6.TOAST / Windows / VisBasAPIex / VBAPIGUIDE.image / COMMCFG.FRM < prev    next >
Text File  |  1992-10-11  |  3KB  |  88 lines

  1. VERSION 2.00
  2. Begin Form Commcfg 
  3.    Caption         =   "CommDemo Configuration"
  4.    Height          =   2145
  5.    Left            =   1455
  6.    LinkMode        =   1  'Source
  7.    LinkTopic       =   "Form1"
  8.    ScaleHeight     =   1740
  9.    ScaleWidth      =   4905
  10.    Top             =   1575
  11.    Width           =   5025
  12.    Begin CommandButton CmdOk 
  13.       Caption         =   "Ok"
  14.       Height          =   495
  15.       Left            =   3960
  16.       TabIndex        =   6
  17.       Top             =   360
  18.       Width           =   735
  19.    End
  20.    Begin Frame Frame2 
  21.       Caption         =   "Speed"
  22.       Height          =   1095
  23.       Left            =   2040
  24.       TabIndex        =   3
  25.       Top             =   240
  26.       Width           =   1695
  27.       Begin OptionButton Option1200 
  28.          Caption         =   "1200 Baud"
  29.          Height          =   255
  30.          Left            =   120
  31.          TabIndex        =   5
  32.          Top             =   720
  33.          Width           =   1215
  34.       End
  35.       Begin OptionButton Option2400 
  36.          Caption         =   "2400 Baud"
  37.          Height          =   255
  38.          Left            =   120
  39.          TabIndex        =   4
  40.          Top             =   360
  41.          Value           =   -1  'True
  42.          Width           =   1455
  43.       End
  44.    End
  45.    Begin Frame Frame1 
  46.       Caption         =   "Device"
  47.       Height          =   1095
  48.       Left            =   240
  49.       TabIndex        =   0
  50.       Top             =   240
  51.       Width           =   1335
  52.       Begin OptionButton OptionCom2 
  53.          Caption         =   "COM2"
  54.          Height          =   255
  55.          Left            =   120
  56.          TabIndex        =   2
  57.          Top             =   720
  58.          Width           =   975
  59.       End
  60.       Begin OptionButton OptionCom1 
  61.          Caption         =   "COM1"
  62.          Height          =   255
  63.          Left            =   120
  64.          TabIndex        =   1
  65.          Top             =   360
  66.          Value           =   -1  'True
  67.          Width           =   975
  68.       End
  69.    End
  70. End
  71. ' The port to use and configuration may have changed
  72. '
  73. Sub CmdOk_Click ()
  74.     Dim baudtouse%
  75.  
  76.     OpenThePort
  77.     
  78.     ' Now make any configuration changes
  79.     If Option1200.Value = True Then baudtouse% = 1200 Else baudtouse% = 2400
  80.     If PortConfig.BaudRate <> baudtouse% Then
  81.         PortConfig.BaudRate = baudtouse%
  82.         If (CommID% >= 0) Then di% = SetCommState(PortConfig)
  83.     End If
  84.     Commcfg.Hide
  85.  
  86. End Sub
  87.  
  88.