VB常用知识——例子代码
有时间会不断的贴出新的内容!VB程序控制光驱
Option Explicit
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim st As Boolean
Private Sub Command1_Click() '弹出按钮
st = True
Call mciSendString("set cdaudio door open", 0, 0, 0)
End Sub
Private Sub Command2_Click() '退出按钮
End
End Sub
Private Sub Form_Load()
End Sub
给大家附上原程序代码
利用VB取ASCII值和KEYCODE值
Private Sub Command2_Click()End
End Sub
Private Sub Form_Load()
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Text2.Text = "keycode码:" & KeyCode
Text1.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Text2.Text = Text2.Text & Chr(13) & Chr(10) & "ASCII码:" & KeyAscii
Text1.Text = ""
End Sub 谢谢,学习了! 呵呵,飘云兄弟学习这个?
可别笑话俺老猪哦!!! /:D /:D 哈哈学习中 学习收藏! 好东东,谢谢大大的不辞劳苦。 真不错呢,嘎嘎。
页:
[1]