Sapphire Buttons Utility可以幫助應(yīng)用程序確認(rèn)用戶是否按下了一個(gè)按鈕。根據(jù)所按的按鈕,您可以執(zhí)行一個(gè)的功能,或者是顯示一個(gè)的屏幕。它還能幫助您的用戶避免由于誤按了一個(gè)系統(tǒng)應(yīng)用程序的按鈕而關(guān)掉原來(lái)的應(yīng)用程序。
Sapphire Buttons Utility allows your application to identify if a button was pressed by the user. Based on what was pressed, you can perform a specific function or display a specific screen. It also helps your users aviod closing applications by accidentally pressing the button for one of the system applications.
需要培訓(xùn)、定制、外包?
請(qǐng)聯(lián)系我們!:800018081
慧都專業(yè)技術(shù)團(tuán)隊(duì)幫助您提高效率,節(jié)省成本,降低風(fēng)險(xiǎn)!
* 關(guān)于本產(chǎn)品的分類與介紹僅供參考,精準(zhǔn)產(chǎn)品資料以介紹為準(zhǔn),如需購(gòu)買請(qǐng)先行測(cè)試。
Sapphire Buttons Utility具有以下功能,能夠很方便的讀取按鈕狀態(tài):
- 檢查按了哪個(gè)按鈕
- 取得按鈕的名字
- 啟用和禁用系統(tǒng)按鈕
實(shí)例代碼 該操作是如此簡(jiǎn)單的,您只需在您的程序中聲明相應(yīng)的DLL函數(shù),然后在您需要的地方調(diào)用即可。下列示例展示了在VB.NET里一個(gè)簡(jiǎn)單的定時(shí)器是如何跟蹤哪個(gè)按鈕被按下的。
Private Sub tmrButtons_Tick(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles tmrButtons.Tick
Dim lButton As Integer
Dim lKey1 As Integer
Dim lKey2 As Integer
lButton = sButtons(1234567890, lKey1, lKey2)
If lButton = 0 Then
lblButton.Text = ""
Else
If lKey2 = 0 Then
lblButton.Text = ButtonName(lKey1)
Else
lblButton.Text = ButtonName(lKey1) & " (" & ButtonName(lKey2) & ")"
End If
End If
End Sub
The Sapphire Buttons Utility makes reading the button status easy with the following functionality:
- Check what button is pressed
- Retrieve the button name
- Enable and disable system buttons
Sample Code
Implementation couldn’t be easier, simply declare the DLL function as a function within your application and call it as though you wrote it yourself. Here’s a sample demo to show how a simple timer can keep track of what button was pressed within VB.NET.
Private Sub tmrButtons_Tick(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles tmrButtons.Tick
Dim lButton As Integer
Dim lKey1 As Integer
Dim lKey2 As Integer
lButton = sButtons(1234567890, lKey1, lKey2)
If lButton = 0 Then
lblButton.Text = ""
Else
If lKey2 = 0 Then
lblButton.Text = ButtonName(lKey1)
Else
lblButton.Text = ButtonName(lKey1) & " (" & ButtonName(lKey2) & ")"
End If
End If
End Sub