wyh1983 发表于 2007-2-18 17:54:19

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


给大家附上原程序代码

wyh1983 发表于 2007-2-18 18:06:54

利用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

飘云 发表于 2007-2-18 19:39:30

谢谢,学习了!

wyh1983 发表于 2007-2-18 19:48:03

呵呵,飘云兄弟学习这个?

可别笑话俺老猪哦!!!

jasonliyi 发表于 2007-2-22 22:38:04

/:D /:D

gxjed369 发表于 2007-2-25 11:36:00

哈哈学习中

ydxydx 发表于 2007-2-28 21:20:12

学习收藏!

wang125 发表于 2007-5-1 22:11:04

好东东,谢谢大大的不辞劳苦。

xiaxueyiyi 发表于 2007-10-4 12:53:53

真不错呢,嘎嘎。
页: [1]
查看完整版本: VB常用知识——例子代码