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

📄 form1.frm

📁 控制print port輸入與輸出的演示範例
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Parallel Port Control"
   ClientHeight    =   5400
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6480
   LinkTopic       =   "Form1"
   ScaleHeight     =   5400
   ScaleWidth      =   6480
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text5 
      Appearance      =   0  'Flat
      Enabled         =   0   'False
      Height          =   285
      Left            =   1800
      Locked          =   -1  'True
      TabIndex        =   12
      Top             =   270
      Width           =   495
   End
   Begin VB.TextBox Text1 
      Alignment       =   1  'Right Justify
      Height          =   285
      Left            =   600
      MaxLength       =   8
      TabIndex        =   10
      Top             =   270
      Width           =   975
   End
   Begin VB.TextBox Text4 
      Height          =   315
      Left            =   5100
      TabIndex        =   8
      Top             =   1020
      Width           =   1245
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Write to Data Port"
      Height          =   405
      Left            =   60
      TabIndex        =   7
      Top             =   1380
      Width           =   1545
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   3525
      Left            =   30
      Picture         =   "Form1.frx":0000
      ScaleHeight     =   3495
      ScaleWidth      =   6360
      TabIndex        =   6
      Top             =   1860
      Width           =   6390
   End
   Begin VB.TextBox Text3 
      Height          =   285
      Left            =   5100
      TabIndex        =   4
      Top             =   660
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   5100
      TabIndex        =   1
      Top             =   300
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Read from Status Port"
      Height          =   375
      Left            =   4620
      TabIndex        =   0
      Top             =   1410
      Width           =   1755
   End
   Begin VB.Label Label7 
      Caption         =   "This project needs your imagination"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00808000&
      Height          =   1185
      Left            =   2490
      TabIndex        =   14
      Top             =   630
      Width           =   1845
   End
   Begin VB.Label Label6 
      Caption         =   "="
      Height          =   225
      Left            =   1620
      TabIndex        =   13
      Top             =   300
      Width           =   195
   End
   Begin VB.Label Label5 
      Caption         =   "Bin"
      Height          =   255
      Left            =   90
      TabIndex        =   11
      Top             =   270
      Width           =   435
   End
   Begin VB.Label Label1 
      Caption         =   "Bin"
      Height          =   255
      Left            =   4620
      TabIndex        =   9
      Top             =   1050
      Width           =   405
   End
   Begin VB.Line Line1 
      X1              =   4470
      X2              =   4470
      Y1              =   150
      Y2              =   1860
   End
   Begin VB.Label Label4 
      Caption         =   "Dec"
      Height          =   255
      Left            =   4620
      TabIndex        =   5
      Top             =   300
      Width           =   375
   End
   Begin VB.Label Label3 
      Caption         =   "Hex"
      Height          =   255
      Left            =   4620
      TabIndex        =   3
      Top             =   660
      Width           =   375
   End
   Begin VB.Label Label2 
      Caption         =   "Value:"
      Height          =   255
      Left            =   5100
      TabIndex        =   2
      Top             =   60
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Value% = DlPortReadPortUchar(&H379)
Text2.Text = Value%
Text3.Text = "&H" + Hex(Value%)
Text4.Text = DecToBin$(Value%)
End Sub

Private Sub Command2_Click()
DlPortWritePortUchar &H378, Val(Text5.Text)
End Sub

Private Sub Text1_Change()
Text5.Text = BinToDec(Val(Text1.Text))
End Sub

⌨️ 快捷键说明

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