⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setf.frm

📁 一份串口通信的好资料,对初学串口者很有用滴
💻 FRM
字号:
VERSION 5.00
Begin VB.Form SETF 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "发送文件设置"
   ClientHeight    =   1380
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   Icon            =   "SETF.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1380
   ScaleWidth      =   4680
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton B_ok 
      Caption         =   "确认"
      Enabled         =   0   'False
      Height          =   375
      Left            =   2040
      TabIndex        =   6
      Top             =   840
      Width           =   1215
   End
   Begin VB.CommandButton B_CANCEL 
      Caption         =   "取消"
      Height          =   375
      Left            =   3360
      TabIndex        =   5
      Top             =   840
      Width           =   1215
   End
   Begin VB.ComboBox Combolen 
      Height          =   300
      Left            =   1320
      Style           =   2  'Dropdown List
      TabIndex        =   4
      Top             =   480
      Width           =   3255
   End
   Begin VB.CommandButton Findpath 
      Caption         =   "..."
      Height          =   255
      Left            =   4080
      TabIndex        =   1
      Top             =   120
      Width           =   495
   End
   Begin VB.TextBox Fpath 
      Height          =   270
      Left            =   1320
      Locked          =   -1  'True
      TabIndex        =   0
      Top             =   120
      Width           =   2655
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      Caption         =   "正文长度(&L):"
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   480
      Width           =   1095
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      Caption         =   "打开文件(&O):"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   120
      Width           =   1095
   End
End
Attribute VB_Name = "SETF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub B_CANCEL_Click()
    
    Unload Me
    
End Sub

Private Sub B_ok_Click()
    
    If Fpath.Text = "" Then
    
        MsgBox "文件名不能为空!请选择一个文件!", vbOKOnly + vbInformation, "提示:"
        Fpath.SetFocus
        
    Else
        
        Me.Visible = False
        
        '
        'initcomm
        '
        TCOM.COMIBUFFER = Me.Combolen.Text
        TCOM.COMOBUFFER = Me.Combolen.Text
        
        '
        
        Fmain.NOTE.Text = "------------------进入发送状态------------------" & vbCrLf
        SendKeys "{PGDN}"
        
        Fmain.send Fpath.Text, Combolen.Text
        Fmain.MSComm.Tag = 1
        'Unload Me
    End If
    
    
End Sub

Private Sub Combolen_Click()
    B_ok.Enabled = True
End Sub

Private Sub Findpath_Click()

    Fmain.CF.CancelError = True
    On Error GoTo ErrHandle
    Fmain.CF.Filter = "*|*"
    Fmain.CF.ShowOpen
    
    Fpath.Text = Fmain.CF.filename
    
ErrHandle:
    Exit Sub
    
End Sub

Private Sub Form_Load()
    Combolen.AddItem "256"
    Combolen.AddItem "512"
    Combolen.AddItem "1024"
    Combolen.AddItem "2048"
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -