王牌刺客吧:vb中如何从键盘中读取1个键

来源:百度文库 编辑:神马品牌网 时间:2024/05/11 03:57:03
在QBasic中可用Inkey$从键盘得到一个键,
从vb中怎么办?

你要取ascii 码吗
用form 的keydowm事件输出keycode就可以了

#include <stdio.h>
#include <string.h>

main ()
{
int a;
a=getch();
printf("%C",a);
}

从键盘得到键值的函数是getch();