樓上的按了一次A+W后,接下來(lái)單按W鍵就會(huì)彈出信息框
站在用戶(hù)的角度思考問(wèn)題,與客戶(hù)深入溝通,找到金寨網(wǎng)站設(shè)計(jì)與金寨網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶(hù)體驗(yàn)好的作品,建站類(lèi)型包括:成都網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)、外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊(cè)、網(wǎng)絡(luò)空間、企業(yè)郵箱。業(yè)務(wù)覆蓋金寨地區(qū)。
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal keyCode As Integer) As Short
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If GetAsyncKeyState(Keys.A) And GetAsyncKeyState(Keys.W) Then
MsgBox("你按下了A+W鍵")
End If
End Sub
End Class
按照順序的話(huà),這樣寫(xiě):
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal keyCode As Integer) As Short
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If GetAsyncKeyState(Keys.A) And e.KeyCode = Keys.W Then
MsgBox("你按下了A+W鍵")
End If
End Sub
End Class
望采納~
你在第一個(gè)窗口里寫(xiě) Form2.ShowDialog()
這樣就可以了,關(guān)掉form2的時(shí)候form1的代碼就會(huì)繼續(xù)執(zhí)行
可以利用msgbox 實(shí)現(xiàn),也可以通過(guò)另外的窗體上畫(huà)出表格實(shí)現(xiàn)
方法一,利用msgbox:
Private Sub Command1_Click()Dim a As Long, b As Long, c As LongMsgBox "┌────┬────┬────┐" vbCrLf _ "│ 庫(kù)存1 │ 庫(kù)存2 │ 庫(kù)存3 │" vbCrLf _ "├────┼────┼────┤" vbCrLf _ "│" formatstr(a) "│" formatstr(b) "│" formatstr(c) "│" vbCrLf _ "└────┴────┴────┘" End SubPrivate Function formatstr(ByVal inputStr As String) As StringDim j As Integerj = (8 - Len(inputStr)) \ 2formatstr = Space(j) inputStr Space(j) Space((8 - Len(inputStr)) Mod 2)End Function
方法二,利用窗體實(shí)現(xiàn):
’新建form2窗體‘將以下代碼復(fù)制到form2窗體中Private Sub Form_Load()ShowPrint "┌────┬────┬────┐" vbCrLf _ "│ 庫(kù)存1 │ 庫(kù)存2 │ 庫(kù)存3 │" vbCrLf _ "├────┼────┼────┤" vbCrLf _ "│" formatstr(a) "│" formatstr(b) "│" formatstr(c) "│" vbCrLf _ "└────┴────┴────┘" End SubPrivate Function formatstr(ByVal inputStr As String) As StringDim j As Integerj = (8 - Len(inputStr)) \ 2formatstr = Space(j) inputStr Space(j) Space((8 - Len(inputStr)) Mod 2)End Function‘將以下代碼復(fù)制在form1窗體中Private Sub Command1_Click()Form2.ShowEnd Sub
名稱(chēng)欄目:vb.net彈出信息 vb如何彈出消息框
分享URL:http://jinyejixie.com/article40/dopppho.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、手機(jī)網(wǎng)站建設(shè)、靜態(tài)網(wǎng)站、標(biāo)簽優(yōu)化、網(wǎng)站改版、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)