VisualBasic第9章鼠标与键盘事件过程.ppt

第九章 鼠标与键盘事件过程 ;9.1 键盘事件;1、 KeyPress事件;1、 KeyPress事件;1、 KeyPress事件;1、 KeyPress事件;例1:text2中输入字符,text3中显示按键对应的ascii值;如果text3中输入一个整数(ASCII),text2中显示其对应字符 Private Sub Text2_KeyPress(KeyAscii As Integer) Text3.Text = KeyAscii End Sub Private Sub Text3_LostFocus() Text2.Text = Chr(Val(Text3.Text)) End Sub;1、 KeyPress事件;;2 KeyDown事件和KeyUp事件 ;(3)事件过程 ;;;;;9.2 鼠标事件 ;;(2)事件过程;;;;;;;;;例 使用鼠标事件编写简单绘图程序 ;9.3 鼠标拖放;;;;;;;;;Private Sub Picture3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Picture3.drag 1 End Sub Private Sub Picture3_MouseUp(Button As Integer, Shift As Int

文档评论(0)

1亿VIP精品文档

相关文档