正在加载图片...
例912修改输入数据,让控件接收的全部为大写字符 将 Keypreview设置为True,并写下列 Form Keypress事件代码: Sub Form Key press(KeyAscii As Integer) TfKeyAscii > Asc(a" And KeyAscii<= Asc("z") Then KeyAscii= KeyAscii-(Asc("a-Asc( a)) End lf End sub 例913假定窗体 Keypreview为True,并有下面事件过程,则 当在文本框中输入“1”时,实际上得到的是“3” Sub form Keypress(KeyAscii AsInteger) KeyAscii= KeyAscii+ 1 End sub Sub texti Keypress(keyascii as integer) KeyAscii= KeyAscii+ 1 End sub例9_1_2修改输入数据,让控件接收的全部为大写字符 将KeyPreview设置为True,并写下列Form_KeyPress事件代码: Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Then KeyAscii = KeyAscii – ( Asc("a") - Asc("A") ) End If End Sub Sub Form_KeyPress(KeyAscii AsInteger) KeyAscii = KeyAscii + 1 End Sub Sub Text1_KeyPress(KeyAscii As Integer) KeyAscii = KeyAscii + 1 End Sub 例9_1_3假定窗体KeyPreview为True,并有下面事件过程,则 当在文本框中输入“1”时,实际上得到的是“3
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有