Visual Basic 6.0中的Keydown事件 [英] Keydown event in visual basic 6.0

查看:146
本文介绍了Visual Basic 6.0中的Keydown事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了所有的东西,以使用visual basic 6.0获取图片移动代码我需要帮助我想移动单位(男人)移动而屏幕是以图片为中心但我似乎无法得到它rea键盘向下键,键盘左键和键盘右键以及键盘上的键盘按键有助于它工作

i have tryied about everything to get a picture to move in code using visual basic 6.0 i need help i would like to move unit(man) to move while to screen is centered on the picture but i cant seem to get it to rea the key down and key left and key right and key up buttons on key board please help to get it to work

推荐答案


i已经尝试了所有东西,以使用visual basic 6.0获取图片移动代码我需要帮助我想移动单位(man)移动而屏幕是以图片为中心但我似乎无法得到它rea键盘上的键向下键和向左键以及键向右键和键盘键有助于使其工作
i have tryied about everything to get a picture to move in code using visual basic 6.0 i need help i would like to move unit(man) to move while to screen is centered on the picture but i cant seem to get it to rea the key down and key left and key right and key up buttons on key board please help to get it to work



你试过SELECT CASE并使用VB常量KeyDown事件?


例如

have you tried with SELECT CASE and using VB constants in the KeyDown event?

e.g.

展开 | 选择 | Wrap | 行号


确定。转到表单,输入表单代码,选择ONE KEY DOWN。在左上角然后写下:


DIm Up为KeyCodeConstants

up = vbKeyUp


如果KeyCode = Up然后

PictureBox.Top = PictureBox.Top + 25

结束如果


你可以使用其他值( +25; +30; - 30和... ...)您可以定义其他按钮。程序结束了。 。 。 。



* VACE *
OK. Go to the form , enter in the form code , select "ONE KEY DOWN" in the left upper corner and then write this:

DIm Up as KeyCodeConstants
up = vbKeyUp

If KeyCode = Up Then
PictureBox.Top = PictureBox.Top + 25
End If

And you can use otther values (+25 ; +30 ; - 30 and . . . . ) and you can define other buttons. And the program is finished . . . .


*VACE*


香港专业教育学院尝试过,但如果我可以将它放到任何地方并且还有屏幕以图片为中心所有我需要的代码我试用的是这个






ive tried that but it dosnt move the picture1 anywhere if i can get it to mave and still have the screen centered on the picture ht all i neeed i the code im trying is this







展开 | 选择 | Wrap | 行号


这篇关于Visual Basic 6.0中的Keydown事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆