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

📄 frm15demo.frm

📁 Nokia FBus
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{997F88E9-8CA8-4FD7-A3C6-F411CF22CD7C}#43.0#0"; "mfbus15.ocx"
Begin VB.Form frm15Demo 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "MobileFBUS 1.5 - New Features"
   ClientHeight    =   3585
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5835
   Icon            =   "frm15Demo.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3585
   ScaleWidth      =   5835
   StartUpPosition =   3  'Windows Default
   Begin MFBUS15.MFBUS15Control MobileFBUSControl1 
      Height          =   480
      Left            =   4680
      TabIndex        =   27
      Top             =   240
      Width           =   480
      _ExtentX        =   847
      _ExtentY        =   847
   End
   Begin VB.CommandButton cmdAbout 
      Caption         =   "?"
      Height          =   375
      Left            =   5400
      TabIndex        =   26
      Top             =   240
      Width           =   375
   End
   Begin VB.CommandButton cmdLogoDemo 
      Caption         =   "Logo Demo"
      Height          =   280
      Left            =   4560
      TabIndex        =   25
      Top             =   1920
      Width           =   1215
   End
   Begin VB.CommandButton cmdSmsDemo 
      Caption         =   "SMS Demo"
      Height          =   280
      Left            =   4560
      TabIndex        =   24
      Top             =   1560
      Width           =   1215
   End
   Begin VB.Frame fraStatus 
      Caption         =   "Extended status info"
      Height          =   975
      Left            =   120
      TabIndex        =   14
      Top             =   2280
      Width           =   5655
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "Provider"
         Height          =   195
         Left            =   100
         TabIndex        =   23
         Top             =   240
         Width           =   585
      End
      Begin VB.Label lblProvider 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   1080
         TabIndex        =   22
         Top             =   240
         Width           =   4455
      End
      Begin VB.Label lblCellId 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   3840
         TabIndex        =   21
         Top             =   600
         Width           =   615
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "Cell"
         Height          =   195
         Left            =   3480
         TabIndex        =   20
         Top             =   600
         Width           =   255
      End
      Begin VB.Label lblLAC 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   4920
         TabIndex        =   19
         Top             =   600
         Width           =   615
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "LAC"
         Height          =   195
         Left            =   4560
         TabIndex        =   18
         Top             =   600
         Width           =   300
      End
      Begin VB.Label lblCurrentCall 
         BorderStyle     =   1  'Fixed Single
         Height          =   255
         Left            =   1080
         TabIndex        =   17
         Top             =   600
         Width           =   1215
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "Current call"
         Height          =   195
         Left            =   100
         TabIndex        =   16
         Top             =   600
         Width           =   795
      End
      Begin VB.Label lblIncoming 
         AutoSize        =   -1  'True
         Caption         =   "INCOMING"
         Height          =   195
         Left            =   2400
         TabIndex        =   15
         Top             =   600
         Visible         =   0   'False
         Width           =   810
      End
   End
   Begin VB.Frame fraDTMF 
      Caption         =   "DTMF support"
      Height          =   975
      Left            =   120
      TabIndex        =   9
      Top             =   1200
      Width           =   4335
      Begin VB.CommandButton cmdDial 
         Caption         =   "Call"
         Height          =   280
         Left            =   2880
         TabIndex        =   13
         Top             =   240
         Width           =   1335
      End
      Begin VB.TextBox txtDial 
         Height          =   285
         Left            =   120
         TabIndex        =   12
         Text            =   "enter phone number here"
         Top             =   240
         Width           =   2535
      End
      Begin VB.TextBox txtDtmf 
         Height          =   285
         Left            =   120
         TabIndex        =   11
         Text            =   "1234567890"
         Top             =   600
         Width           =   2535
      End
      Begin VB.CommandButton cmdSendDtmf 
         Caption         =   "Send DTMF"
         Height          =   280
         Left            =   2880
         TabIndex        =   10
         Top             =   600
         Width           =   1335
      End
   End
   Begin VB.Frame fraDateTime 
      Caption         =   "Date/Time support"
      Height          =   975
      Left            =   120
      TabIndex        =   3
      Top             =   120
      Width           =   4335
      Begin VB.TextBox txtDateTime 
         Height          =   285
         Left            =   120
         TabIndex        =   7
         Top             =   240
         Width           =   2535
      End
      Begin VB.CommandButton cmdSetDateTime 
         Caption         =   "Set Date/Time"
         Height          =   280
         Left            =   2880
         TabIndex        =   6
         Top             =   240
         Width           =   1335
      End
      Begin VB.CommandButton cmdAlarm 
         Caption         =   "Set Alarm"
         Height          =   280
         Left            =   2880
         TabIndex        =   5
         Top             =   600
         Width           =   1335
      End
      Begin VB.TextBox txtAlarm 
         Height          =   285
         Left            =   1200
         TabIndex        =   4
         Top             =   600
         Width           =   1455
      End
      Begin VB.Label lblAlarm 
         Caption         =   "Alarm "
         Height          =   255
         Left            =   120
         TabIndex        =   8
         Top             =   600
         Width           =   975
      End
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   10000
      Left            =   5160
      Top             =   360
   End
   Begin VB.ComboBox cmbPort 
      Height          =   315
      ItemData        =   "frm15Demo.frx":0442
      Left            =   4560
      List            =   "frm15Demo.frx":044C
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   1200
      Width           =   1095
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   255
      Left            =   0
      TabIndex        =   0
      Top             =   3330
      Width           =   5835
      _ExtentX        =   10292
      _ExtentY        =   450
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   5795
            MinWidth        =   5292
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   2
            Object.Width           =   4410
            MinWidth        =   4410
         EndProperty
      EndProperty
   End
   Begin VB.Label Label1 
      Caption         =   "Phone at port:"
      Height          =   255
      Left            =   4560
      TabIndex        =   2
      Top             =   960
      Width           =   1215
   End
End
Attribute VB_Name = "frm15Demo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_Port As String
Private m_Initialising As Boolean

Private Sub cmbPort_Click()
  If (m_Port <> cmbPort.Text) And Not m_Initialising Then
    DoEvents
    InitForm
  End If
End Sub

Private Sub cmdAbout_Click()
  MobileFBUSControl1.About
End Sub

Private Sub cmdAlarm_Click()
  On Error Resume Next
  MobileFBUSControl1.AlarmTime = CDate(txtAlarm.Text)
  txtAlarm.Text = Format(MobileFBUSControl1.AlarmTime, "hh:mm")
  lblAlarm.Caption = IIf(MobileFBUSControl1.AlarmEnabled, "Alarm ON", "Alarm OFF")
End Sub

Private Sub cmdDial_Click()
  On Error GoTo cmdDial_Error
  'MobileFBUSControl1.Connect m_Port
  MobileFBUSControl1.VoiceCall txtDial.Text
  'MobileFBUSControl1.Disconnect
cmdDial_Error:
End Sub

Private Sub cmdLogoDemo_Click()
  Screen.MousePointer = vbHourglass
  frmLogoDemo.Show vbModal, Me
  MobileFBUSControl1.AnimateLogo = False
  Screen.MousePointer = vbDefault
End Sub

Private Sub cmdSendDtmf_Click()
  MobileFBUSControl1.SendDtmf txtDtmf.Text
End Sub

Private Sub cmdSetDateTime_Click()
  On Error Resume Next
  MobileFBUSControl1.DateTime = CDate(txtDateTime.Text)
End Sub

Private Sub InitForm()
    m_Initialising = True
    On Error GoTo Init_Error
    Screen.MousePointer = vbHourglass
    DoEvents
    m_Port = cmbPort.Text
    StatusBar1.Panels(1).Text = "Connecting to phone ..."
    DoEvents
    MobileFBUSControl1.Connect m_Port
    txtDateTime.Text = CStr(Now())
    txtAlarm.Text = Format(MobileFBUSControl1.AlarmTime, "hh:mm")
    lblAlarm.Caption = IIf(MobileFBUSControl1.AlarmEnabled, "Alarm ON", "Alarm OFF")
    Screen.MousePointer = vbDefault
    StatusBar1.Panels(1).Text = "Ready"
    Timer1.Enabled = True
    Timer1_Timer
    m_Initialising = False
    Exit Sub
Init_Error:
    Screen.MousePointer = vbDefault
    StatusBar1.Panels(1).Text = "Error " & Err.Number & " - " & Err.Description
    m_Port = ""
    m_Initialising = False
End Sub

Private Sub cmdSmsDemo_Click()
  Screen.MousePointer = vbHourglass
  frmSmsDemo.Show vbModal, Me
  Screen.MousePointer = vbDefault
End Sub

Private Sub Form_Load()
  Me.Show
  DoEvents
  cmbPort.Text = "COM1"
End Sub

Private Sub Form_Unload(Cancel As Integer)
  On Error Resume Next
  Unload frmSmsDemo
  If MobileFBUSControl1.Connected Then MobileFBUSControl1.Disconnect
End Sub

Private Sub MobileFBUSControl1_IncomingCall(ByVal sIncomingNumber As String)
  MsgBox "Incoming call " & sIncomingNumber
End Sub

Private Sub MobileFBUSControl1_LogoAnimation(ByVal iFrame As Integer, ByVal iTotalFrames As Integer)
  frmLogoDemo.PaintLogo
End Sub

Private Sub Timer1_Timer()
  Dim sTxt As String
  
  On Error Resume Next
  
  ' get date/time and status signals
  sTxt = CStr(MobileFBUSControl1.DateTime) & " "
  If MobileFBUSControl1.KeyboardLocked Then sTxt = sTxt & "K"
  If MobileFBUSControl1.CallInProgress Then sTxt = sTxt & "C"
  StatusBar1.Panels(2).Text = sTxt
  
  ' get signal and battery level
  sTxt = "Signal " & CStr(MobileFBUSControl1.RfLevel) & " - Battery " & CStr(MobileFBUSControl1.BatteryLevel)
  If MobileFBUSControl1.ACDCPower Then sTxt = sTxt & " ACDC"
  StatusBar1.Panels(1).Text = sTxt
  
  ' get provider and cell data
  lblProvider.Caption = MobileFBUSControl1.ProviderName & " (" & MobileFBUSControl1.ProviderCountry & ")"
  lblProvider.Refresh
  lblCellId.Caption = MobileFBUSControl1.CellId
  lblCellId.Refresh
  lblLAC.Caption = MobileFBUSControl1.LAC
  lblLAC.Refresh
  
  ' get call data
  lblCurrentCall.Caption = MobileFBUSControl1.CurrentCallNr
  lblCurrentCall.Refresh
  lblIncoming.Visible = MobileFBUSControl1.IncomingCallInProgress
End Sub

⌨️ 快捷键说明

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