📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "电话拨号程序"
ClientHeight = 2985
ClientLeft = 3765
ClientTop = 3720
ClientWidth = 4065
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 2985
ScaleWidth = 4065
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 435
TabIndex = 13
Top = 420
Width = 3270
End
Begin VB.CommandButton Command3
Caption = "拨号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Left = 3000
TabIndex = 12
Top = 2220
Width = 720
End
Begin VB.CommandButton Command2
Caption = "清空"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Left = 2160
TabIndex = 11
Top = 2220
Width = 720
End
Begin VB.CommandButton Command1
Caption = "0"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 9
Left = 1320
TabIndex = 10
Top = 2220
Width = 720
End
Begin VB.CommandButton Command1
Caption = "9"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 8
Left = 435
TabIndex = 9
Top = 2220
Width = 720
End
Begin VB.CommandButton Command1
Caption = "8"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 7
Left = 3000
TabIndex = 8
Top = 1545
Width = 720
End
Begin VB.CommandButton Command1
Caption = "7"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 6
Left = 2160
TabIndex = 7
Top = 1545
Width = 720
End
Begin VB.CommandButton Command1
Caption = "6"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 5
Left = 1320
TabIndex = 6
Top = 1545
Width = 720
End
Begin VB.CommandButton Command1
Caption = "5"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 4
Left = 435
TabIndex = 5
Top = 1545
Width = 720
End
Begin VB.CommandButton Command1
Caption = "4"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 3
Left = 3000
TabIndex = 4
Top = 885
Width = 720
End
Begin VB.CommandButton Command1
Caption = "3"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 2
Left = 2160
TabIndex = 3
Top = 885
Width = 720
End
Begin VB.CommandButton Command1
Caption = "2"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 1
Left = 1320
TabIndex = 2
Top = 885
Width = 720
End
Begin VB.CommandButton Command1
Caption = "1"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Index = 0
Left = 435
TabIndex = 1
Top = 885
Width = 720
End
Begin VB.Label Label1
Caption = "电话号码:"
Height = 195
Left = 465
TabIndex = 0
Top = 120
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function tapiRequestMakeCall& Lib "TAPI32.DLL" (ByVal DestAddress$, ByVal AppName$, ByVal CalledParty$, ByVal Comment$)
Private Const TAPIERR_NOREQUESTRECIPIENT = -2&
Private Const TAPIERR_REQUESTQUEUEFULL = -3&
Private Const TAPIERR_INVALDESTADDRESS = -4&
Private Sub Text1_Change()
Command3.Enabled = Len(Trim(Text1.Text))
End Sub
Private Sub Command1_Click(Index As Integer) '输入号码
Select Case Index
Case 0
Text1.Text = Text1.Text & 1
Case 1
Text1.Text = Text1.Text & 2
Case 2
Text1.Text = Text1.Text & 3
Case 3
Text1.Text = Text1.Text & 4
Case 4
Text1.Text = Text1.Text & 5
Case 5
Text1.Text = Text1.Text & 6
Case 6
Text1.Text = Text1.Text & 7
Case 7
Text1.Text = Text1.Text & 8
Case 8
Text1.Text = Text1.Text & 9
Case 9
Text1.Text = Text1.Text & 0
End Select
Text1.Enabled = True
End Sub
Private Sub Command2_Click() '清空拨号
Text1.Text = ""
End Sub
Private Sub Command3_Click() '拨号
Dim buff As String
Dim nResult As Long
nResult = tapiRequestMakeCall&(Trim(Text1), CStr(Caption), "Test Dial", "")
If nResult <> 0 Then
buff = "错误信息:"
Select Case nResult
Case TAPIERR_NOREQUESTRECIPIENT
buff = buff & "没有可用的拨号程序"
Case TAPIERR_INVALDESTADDRESS
buff = buff & "无效输入"
End Select
MsgBox buff
End If
End Sub
Private Sub Command4_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -