📄 frmsmsdemo.frm
字号:
VERSION 5.00
Begin VB.Form frmSmsDemo
BorderStyle = 3 'Fixed Dialog
Caption = "SMS Demo"
ClientHeight = 3360
ClientLeft = 45
ClientTop = 330
ClientWidth = 5070
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3360
ScaleWidth = 5070
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.ListBox lstMsg
Height = 1620
Left = 120
TabIndex = 1
Top = 480
Width = 4815
End
Begin VB.ComboBox cmbBox
Height = 315
ItemData = "frmSmsDemo.frx":0000
Left = 1680
List = "frmSmsDemo.frx":000D
Style = 2 'Dropdown List
TabIndex = 0
Top = 120
Width = 3255
End
Begin VB.Label Label1
Caption = "SMS messagebox"
Height = 255
Left = 120
TabIndex = 3
Top = 120
Width = 1455
End
Begin VB.Label lblMsgText
BorderStyle = 1 'Fixed Single
Height = 1095
Left = 120
TabIndex = 2
Top = 2160
Width = 4815
End
End
Attribute VB_Name = "frmSmsDemo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_SmsBox As FBSmsBox
Private Sub cmbBox_Click()
Dim i As Integer, sMsg As String
lstMsg.Visible = False
lstMsg.Clear
With frm15Demo.MobileFBUSControl1
Select Case cmbBox.Text
Case "Inbox"
Set m_SmsBox = .sms.Inbox
Case "Outbox"
Set m_SmsBox = .sms.Outbox
Case "Delivery Notifications"
Set m_SmsBox = .sms.DeliveryNotifications
Case Else
Exit Sub
End Select
End With
For i = 1 To m_SmsBox.Count
With m_SmsBox(i)
sMsg = CStr(.DateTime)
If .Sender <> "" Then
sMsg = sMsg & " from:" & .Sender
End If
If .Destination <> "" Then
sMsg = sMsg & " to:" & .Destination
End If
If Not .SentRead Then
sMsg = sMsg & " (unread)"
End If
End With
lstMsg.AddItem sMsg
Next i
If lstMsg.ListCount > 0 Then
lstMsg.ListIndex = 0
Else
lblMsgText.Caption = ""
End If
lstMsg.Visible = True
End Sub
Private Sub Form_Load()
frm15Demo.MobileFBUSControl1.sms.Refresh ' load sms message list from phone
cmbBox.Text = "Inbox"
Screen.MousePointer = vbDefault
End Sub
Private Sub lstMsg_Click()
If lstMsg.ListIndex >= 0 Then
On Error Resume Next ' in case m_SmsBox is invalid
lblMsgText.Caption = m_SmsBox(lstMsg.ListIndex + 1).Text
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -