comfrom.frm
上传用户:huitekeji
上传日期:2013-04-14
资源大小:40k
文件大小:10k
源码类别:

TCP/IP协议栈

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form comfrom 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "属性设定"
  6.    ClientHeight    =   5295
  7.    ClientLeft      =   45
  8.    ClientTop       =   435
  9.    ClientWidth     =   7125
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   5295
  14.    ScaleWidth      =   7125
  15.    StartUpPosition =   3  '窗口缺省
  16.    Begin VB.Frame Frame2 
  17.       Height          =   3855
  18.       Left            =   4200
  19.       TabIndex        =   16
  20.       Top             =   600
  21.       Width           =   2655
  22.       Begin VB.ComboBox Combo10 
  23.          Height          =   300
  24.          Left            =   360
  25.          Style           =   2  'Dropdown List
  26.          TabIndex        =   24
  27.          Top             =   2040
  28.          Width           =   2055
  29.       End
  30.       Begin VB.ComboBox Combo9 
  31.          Height          =   300
  32.          Left            =   360
  33.          Style           =   2  'Dropdown List
  34.          TabIndex        =   23
  35.          Top             =   1320
  36.          Width           =   2055
  37.       End
  38.       Begin VB.ComboBox Combo8 
  39.          Height          =   300
  40.          Left            =   360
  41.          Style           =   2  'Dropdown List
  42.          TabIndex        =   22
  43.          Top             =   2760
  44.          Width           =   2055
  45.       End
  46.       Begin VB.ComboBox Combo7 
  47.          Height          =   300
  48.          Left            =   360
  49.          Style           =   2  'Dropdown List
  50.          TabIndex        =   21
  51.          Top             =   600
  52.          Width           =   2055
  53.       End
  54.       Begin VB.Label Label10 
  55.          AutoSize        =   -1  'True
  56.          Caption         =   "产生事件字节"
  57.          Height          =   180
  58.          Left            =   120
  59.          TabIndex        =   20
  60.          Top             =   1080
  61.          Width           =   1080
  62.       End
  63.       Begin VB.Label Label9 
  64.          AutoSize        =   -1  'True
  65.          Caption         =   "接收缓冲区"
  66.          Height          =   180
  67.          Left            =   120
  68.          TabIndex        =   19
  69.          Top             =   1800
  70.          Width           =   900
  71.       End
  72.       Begin VB.Label Label8 
  73.          AutoSize        =   -1  'True
  74.          Caption         =   "接收发送模式"
  75.          Height          =   180
  76.          Left            =   120
  77.          TabIndex        =   18
  78.          Top             =   2520
  79.          Width           =   1080
  80.       End
  81.       Begin VB.Label Label7 
  82.          AutoSize        =   -1  'True
  83.          Caption         =   "接收方式"
  84.          Height          =   180
  85.          Left            =   120
  86.          TabIndex        =   17
  87.          Top             =   360
  88.          Width           =   720
  89.       End
  90.    End
  91.    Begin VB.CommandButton Command2 
  92.       Caption         =   "取消"
  93.       Height          =   375
  94.       Left            =   5880
  95.       TabIndex        =   15
  96.       Top             =   4800
  97.       Width           =   975
  98.    End
  99.    Begin VB.CommandButton Command1 
  100.       Caption         =   "确定"
  101.       Height          =   375
  102.       Left            =   4560
  103.       TabIndex        =   14
  104.       Top             =   4800
  105.       Width           =   1095
  106.    End
  107.    Begin VB.Frame Frame1 
  108.       Height          =   3855
  109.       Left            =   240
  110.       TabIndex        =   1
  111.       Top             =   600
  112.       Width           =   3855
  113.       Begin VB.ComboBox Combo6 
  114.          Height          =   300
  115.          Left            =   1200
  116.          Style           =   2  'Dropdown List
  117.          TabIndex        =   7
  118.          Top             =   3240
  119.          Width           =   2415
  120.       End
  121.       Begin VB.ComboBox Combo5 
  122.          Height          =   300
  123.          Left            =   1200
  124.          Style           =   2  'Dropdown List
  125.          TabIndex        =   6
  126.          Top             =   2640
  127.          Width           =   2415
  128.       End
  129.       Begin VB.ComboBox Combo4 
  130.          Height          =   300
  131.          Left            =   1200
  132.          Style           =   2  'Dropdown List
  133.          TabIndex        =   5
  134.          Top             =   2040
  135.          Width           =   2415
  136.       End
  137.       Begin VB.ComboBox Combo3 
  138.          Height          =   300
  139.          Left            =   1200
  140.          Style           =   2  'Dropdown List
  141.          TabIndex        =   4
  142.          Top             =   1440
  143.          Width           =   2415
  144.       End
  145.       Begin VB.ComboBox Combo2 
  146.          Height          =   300
  147.          Left            =   1200
  148.          Style           =   2  'Dropdown List
  149.          TabIndex        =   3
  150.          Top             =   840
  151.          Width           =   2415
  152.       End
  153.       Begin VB.ComboBox Combo1 
  154.          Height          =   300
  155.          Left            =   1200
  156.          Style           =   2  'Dropdown List
  157.          TabIndex        =   2
  158.          Top             =   240
  159.          Width           =   2415
  160.       End
  161.       Begin VB.Label Label6 
  162.          AutoSize        =   -1  'True
  163.          Caption         =   "数据流控制"
  164.          Height          =   180
  165.          Left            =   240
  166.          TabIndex        =   13
  167.          Top             =   3360
  168.          Width           =   900
  169.       End
  170.       Begin VB.Label Label5 
  171.          AutoSize        =   -1  'True
  172.          Caption         =   "停止位"
  173.          Height          =   180
  174.          Left            =   600
  175.          TabIndex        =   12
  176.          Top             =   2760
  177.          Width           =   540
  178.       End
  179.       Begin VB.Label Label4 
  180.          AutoSize        =   -1  'True
  181.          Caption         =   "奇偶校验"
  182.          Height          =   180
  183.          Left            =   360
  184.          TabIndex        =   11
  185.          Top             =   2160
  186.          Width           =   720
  187.       End
  188.       Begin VB.Label Label3 
  189.          AutoSize        =   -1  'True
  190.          Caption         =   "数据位"
  191.          Height          =   180
  192.          Left            =   480
  193.          TabIndex        =   10
  194.          Top             =   1560
  195.          Width           =   540
  196.       End
  197.       Begin VB.Label Label2 
  198.          AutoSize        =   -1  'True
  199.          Caption         =   "波特率"
  200.          Height          =   180
  201.          Left            =   480
  202.          TabIndex        =   9
  203.          Top             =   960
  204.          Width           =   540
  205.       End
  206.       Begin VB.Label Label1 
  207.          AutoSize        =   -1  'True
  208.          Caption         =   "端口号"
  209.          Height          =   180
  210.          Left            =   480
  211.          TabIndex        =   8
  212.          Top             =   360
  213.          Width           =   540
  214.       End
  215.    End
  216.    Begin MSComctlLib.TabStrip TabStrip1 
  217.       Height          =   4575
  218.       Left            =   120
  219.       TabIndex        =   0
  220.       Top             =   120
  221.       Width           =   6855
  222.       _ExtentX        =   12091
  223.       _ExtentY        =   8070
  224.       _Version        =   393216
  225.       BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
  226.          NumTabs         =   1
  227.          BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  228.             ImageVarType    =   2
  229.          EndProperty
  230.       EndProperty
  231.    End
  232. End
  233. Attribute VB_Name = "comfrom"
  234. Attribute VB_GlobalNameSpace = False
  235. Attribute VB_Creatable = False
  236. Attribute VB_PredeclaredId = True
  237. Attribute VB_Exposed = False
  238. Private Sub Command1_Click()
  239.  
  240.     With mycom
  241.         If Combo1.Text = "COM1" Then .comm = 1
  242.         If Combo1.Text = "COM2" Then .comm = 2
  243.         If Combo1.Text = "COM3" Then .comm = 3
  244.         If Combo1.Text = "COM4" Then .comm = 4
  245.         If Combo1.Text = "COM5" Then .comm = 5
  246.         If Combo1.Text = "COM6" Then .comm = 6
  247.         If Combo1.Text = "COM7" Then .comm = 7
  248.         
  249.         .seting = Combo2.Text & ","
  250.         If Combo4.Text = "偶校验" Then .seting = .seting & "E,"
  251.         If Combo4.Text = "奇校验" Then .seting = .seting & "O,"
  252.         If Combo4.Text = "无" Then .seting = .seting & "N,"
  253.         .seting = .seting & Combo3.Text & "," & Combo5.Text
  254.         
  255.         If Combo6.Text = "无" Then .hands = 0
  256.         If Combo6.Text = "XOnXOff" Then .hands = 1
  257.         If Combo6.Text = "硬件" Then .hands = 2
  258.         
  259.         If Combo7.Text = "事件" Then .RTbyte = 1
  260.         If Combo7.Text = "等待" Then .RTbyte = 0
  261.         
  262.         If Combo8.Text = "comInputModeBinary" Then .INmode = 1
  263.         If Combo8.Text = "comInputModeText" Then .INmode = 0
  264.       
  265.         .INlen = Combo9.Text
  266.         .INsize = Combo10.Text
  267.         
  268.     
  269.     End With
  270.     
  271.     Unload Me
  272. End Sub
  273. Private Sub Command2_Click()
  274.     Unload Me
  275. End Sub
  276. Private Sub Form_Load()
  277. Combo1.AddItem "COM1"
  278. Combo1.AddItem "COM2"
  279. Combo1.AddItem "COM3"
  280. Combo1.AddItem "COM4"
  281. Combo1.AddItem "COM5"
  282. Combo1.AddItem "COM6"
  283. Combo1.AddItem "COM7"
  284. Combo1.ListIndex = 0
  285. Combo2.AddItem "4800"
  286. Combo2.AddItem "9600"
  287. Combo2.AddItem "19200"
  288. Combo2.AddItem "38400"
  289. Combo2.AddItem "54600"
  290. Combo2.AddItem "115100"
  291. Combo2.ListIndex = 1
  292. Combo3.AddItem "5"
  293. Combo3.AddItem "6"
  294. Combo3.AddItem "7"
  295. Combo3.AddItem "8"
  296. Combo3.ListIndex = 3
  297. Combo4.AddItem "偶校验"
  298. Combo4.AddItem "奇校验"
  299. Combo4.AddItem "无"
  300. Combo4.ListIndex = 2
  301. Combo5.AddItem "1"
  302. Combo5.AddItem "1.5"
  303. Combo5.AddItem "2"
  304. Combo5.ListIndex = 0
  305. Combo6.AddItem "Xon/Xoff"
  306. Combo6.AddItem "硬件"
  307. Combo6.AddItem "无"
  308. Combo6.ListIndex = 2
  309. Combo7.AddItem "事件"
  310. Combo7.AddItem "等待"
  311. Combo7.ListIndex = 0
  312. Combo8.AddItem "comInputModeBinary"
  313. Combo8.AddItem "comInputModeText"
  314. Combo8.ListIndex = 0
  315. Dim i As Integer
  316. For i = 1 To 10
  317.   Combo9.AddItem i
  318. Next
  319. Combo9.ListIndex = 0
  320. For i = 1 To 10
  321.   Combo10.AddItem i * 10
  322. Next
  323. Combo10.ListIndex = 3
  324. End Sub