[C++\Cli]只允許鍵盤數字輸入

摘要:只允許鍵盤數字輸入

 

   

if (Char::IsDigit(e->KeyChar) || Char::IsControl(e->KeyChar) ||e->KeyChar == 46 || e->KeyChar == '-') 
{
	e->Handled = false;
} 
else
{
	e->Handled = true;
}