📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "电话拨号程序"
ClientHeight = 4035
ClientLeft = 3765
ClientTop = 3720
ClientWidth = 4545
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 4035
ScaleWidth = 4545
ShowInTaskbar = 0 'False
Begin VB.TextBox number1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 435
TabIndex = 14
Top = 420
Width = 3735
End
Begin VB.CommandButton Command3
Caption = "拨号..."
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 435
TabIndex = 13
Top = 825
Width = 3765
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 = 570
Left = 2430
TabIndex = 12
Top = 2760
Width = 1770
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 = 570
Index = 9
Left = 1440
TabIndex = 11
Top = 2760
Width = 780
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 = 570
Index = 8
Left = 435
TabIndex = 10
Top = 2760
Width = 780
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 = 570
Index = 7
Left = 3420
TabIndex = 9
Top = 2055
Width = 780
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 = 570
Index = 6
Left = 2430
TabIndex = 8
Top = 2055
Width = 765
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 = 570
Index = 5
Left = 1440
TabIndex = 7
Top = 2055
Width = 780
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 = 570
Index = 4
Left = 435
TabIndex = 6
Top = 2055
Width = 780
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 = 570
Index = 3
Left = 3420
TabIndex = 5
Top = 1350
Width = 780
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 = 570
Index = 2
Left = 2430
TabIndex = 4
Top = 1350
Width = 765
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 = 570
Index = 1
Left = 1440
TabIndex = 3
Top = 1350
Width = 780
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 = 570
Index = 0
Left = 435
TabIndex = 2
Top = 1350
Width = 780
End
Begin VB.CommandButton Command4
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 435
TabIndex = 1
Top = 3495
Width = 3765
End
Begin VB.Label Label1
Caption = "电话号码:"
Height = 255
Left = 495
TabIndex = 0
Top = 105
Width = 1935
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 Form_Load()
Command3.Enabled = False
End Sub
Private Sub number1_Change()
Command3.Enabled = Len(Trim(number1.Text))
End Sub
Private Sub Command1_Click(Index As Integer) '输入号码
Select Case Index
Case 0
number1.Text = number1.Text & 1
Case 1
number1.Text = number1.Text & 2
Case 2
number1.Text = number1.Text & 3
Case 3
number1.Text = number1.Text & 4
Case 4
number1.Text = number1.Text & 5
Case 5
number1.Text = number1.Text & 6
Case 6
number1.Text = number1.Text & 7
Case 7
number1.Text = number1.Text & 8
Case 8
number1.Text = number1.Text & 9
Case 9
number1.Text = number1.Text & 0
End Select
number1.Enabled = True
End Sub
Private Sub Command2_Click() '清空拨号
number1.Text = ""
End Sub
Private Sub Command3_Click() '拨号
Dim buff As String
Dim nResult As Long
nResult = tapiRequestMakeCall&(Trim(number1), 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 + -