且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Basic 6.0中的Keydown事件

更新时间:2023-09-21 21:43:28


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 | 行号