键盘对图像的移动操作
点击次数:37 次 发布日期:2008-11-09 08:40:40 作者:源代码网
|
源代码网推荐 源代码网推荐 OnKeyPressr当按下一个ASCII的字时有效,对于其他没有反应. 源代码网推荐 源代码网推荐 源代码网推荐 //根据上下左右来改变图的位置 源代码网推荐 if key = vk_up then 源代码网推荐 image1.Top :=image1.top-32 源代码网推荐 else if key = vk_down then 源代码网推荐 image1.Top :=image1.top 32 源代码网推荐 else if key = vk_left then 源代码网推荐 image1.left :=image1.left-32 源代码网推荐 else if key = vk_right then 源代码网推荐 image1.left :=image1.left 32; 源代码网推荐 源代码网推荐 补充 源代码网推荐 //自己看吧 源代码网推荐 procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); 源代码网推荐 begin 源代码网推荐 if key in ["0".."9"] then 源代码网推荐 ShowMessage("按下0至9"); 源代码网推荐 源代码网推荐 end; 源代码网推荐 源代码网供稿. |
