?? main.frm
字號:
VERSION 5.00
Begin VB.Form frmMain
BorderStyle = 3 'Fixed Dialog
Caption = "LPT Ports"
ClientHeight = 2625
ClientLeft = 30
ClientTop = 330
ClientWidth = 4740
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2625
ScaleWidth = 4740
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 3360
TabIndex = 5
Top = 1320
Width = 1095
End
Begin VB.CommandButton btnClose
Caption = "Close"
Height = 372
Left = 3240
TabIndex = 3
Top = 720
Width = 1332
End
Begin VB.CommandButton btnGet
Caption = "Get"
Height = 372
Left = 3240
TabIndex = 2
Top = 240
Width = 1332
End
Begin VB.ListBox List1
Height = 1320
Left = 240
TabIndex = 1
Top = 360
Width = 2772
End
Begin VB.Label Label2
Caption = "Copyright (c) 1999-2001 Hai Li, Zeal SoftStudio http://www.zealsoftstudio.com"
Height = 492
Left = 120
TabIndex = 4
Top = 2040
Width = 4572
End
Begin VB.Label Label1
Caption = "Result:"
Height = 252
Left = 240
TabIndex = 0
Top = 120
Width = 972
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' LPTPort sample
' Copyright (c) 1997-2001 Hai Li, Zeal SoftStudio.
' E-Mail:info@zealsoftstudio.com
' http://www.zealsoftstudio.com (English)
' http://www.nease.net/~zealsoft/ (Chinese)
' This sample illustrates how to use NTPort
' Library to get LPT ports address.
Option Explicit
Dim nAddress As Integer
Dim i, nError As Integer
Private Sub btnClose_Click()
End
End Sub
Private Sub btnGet_Click()
Dim nAddress As Integer
Dim i, nError As Integer
List1.Clear
For i = 1 To 3
nAddress = GetLPTPortAddress(i)
nError = GetLastState(vbNullString)
If nAddress Then
List1.AddItem "LPT" & i & ": " & Hex(nAddress) & "H"
ElseIf nError Then
List1.AddItem "LPT" & i & ": Error"
Else
List1.AddItem "LPT" & i & ": absent"
End If
Next
End Sub
Private Sub Command1_Click()
nAddress = GetLPTPortAddress(1)
List1.AddItem "LPT" & i
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -