MFC Edit 有关问题
MFC Edit 问题
m_cEditAllTime.GetWindowText(m_sAllTime);
m_cEditLineTime.GetWindowText(m_sLineTime);
int m_iAllTime = _tstoi(m_sAllTime);
int m_iLineTime = _tstoi(m_sLineTime);
if (GetAsyncKeyState('A') & 0x8000)//按下
{
}
else //松开
{
}
if (GetAsyncKeyState('S') & 0x8000)
{
}
else
{
}
if (GetAsyncKeyState('D') & 0x8000)
{
}
else
{
}
if (GetAsyncKeyState('J') & 0x8000)
{
}
else
{
}
if (GetAsyncKeyState('K') & 0x8000)
{
}
else
{
}
if (GetAsyncKeyState('L') & 0x8000)
{
}
else
{
}
CDialog::OnTimer(nIDEvent);
6个按键,按下的话是1,没按下的话是0,Edit每行只输入6个字符,每行也就是6个键的按下松开信息,最多只
支持2个键同时按下,同时把信息输入到edit上
想了半天没思路,比如按下两个键,其他四个键怎么用0补充呢..求大大帮忙
------解决方案--------------------
Edit初始化为000000,每按下一个按键,相应数值置为1,如按下S,Edit的值为010000;
不知道楼主是不是这个意思?
m_cEditAllTime.GetWindowText(m_sAllTime);
m_cEditLineTime.GetWindowText(m_sLineTime);
int m_iAllTime = _tstoi(m_sAllTime);
int m_iLineTime = _tstoi(m_sLineTime);
if (GetAsyncKeyState('A') & 0x8000)//按下
{
}
else //松开
{
}
if (GetAsyncKeyState('S') & 0x8000)
{
}
else
{
}
if (GetAsyncKeyState('D') & 0x8000)
{
}
else
{
}
if (GetAsyncKeyState('J') & 0x8000)
{
}
else
{
}
if (GetAsyncKeyState('K') & 0x8000)
{
}
else
{
}
if (GetAsyncKeyState('L') & 0x8000)
{
}
else
{
}
CDialog::OnTimer(nIDEvent);
6个按键,按下的话是1,没按下的话是0,Edit每行只输入6个字符,每行也就是6个键的按下松开信息,最多只
支持2个键同时按下,同时把信息输入到edit上
想了半天没思路,比如按下两个键,其他四个键怎么用0补充呢..求大大帮忙
------解决方案--------------------
Edit初始化为000000,每按下一个按键,相应数值置为1,如按下S,Edit的值为010000;
不知道楼主是不是这个意思?