This commit is contained in:
2026-06-23 21:59:23 +08:00
parent cb9997217a
commit 6cdbb4e84b
8 changed files with 156 additions and 14 deletions
+15 -3
View File
@@ -32,6 +32,8 @@ void __fastcall TActCodeForm::FormCreate(TObject *Sender)
m_lbTips->Caption = Format(String("有效期至:%.4d-%.2d-%.2d %.2d:%.2d"),
ARRAYOFCONST((dt->tm_year+1900, dt->tm_mon+1, dt->tm_mday, dt->tm_hour, dt->tm_min)));
}
m_btnReset->Enabled = true;
}
else
m_lbTips->Caption = "请输入授权码并验证";
@@ -39,8 +41,8 @@ void __fastcall TActCodeForm::FormCreate(TObject *Sender)
//---------------------------------------------------------------------------
void __fastcall TActCodeForm::OnCodeChange(TObject *Sender)
{
m_btnOk->Caption = "验证";
m_btnOk->Enabled = m_leActCode->Text.Length()>0;
m_btnOk->Caption = m_leActCode->Text.Length()>0 ? "验证" : "关闭";
m_btnReset->Enabled = m_leActCode->Text.Length()>0;
if(m_tExpire>0){
m_tExpire = 0;
@@ -55,7 +57,9 @@ void __fastcall TActCodeForm::OnCodeKeyPress(TObject *Sender, System::WideChar &
else if(Key<0x1E)
return;
if((Key>'9' || Key<'0') && (Key<'A' || Key>'F'))
if(Key>='a' && Key<='f')
Key -= 32;
else if((Key>'9' || Key<'0') && (Key<'A' || Key>'F'))
Key = 0;
}
//---------------------------------------------------------------------------
@@ -112,4 +116,12 @@ void __fastcall TActCodeForm::UMUserConfirm(TMessage &msg)
}
}
//---------------------------------------------------------------------------
void __fastcall TActCodeForm::OnResetClick(TObject *Sender)
{
m_leActCode->Text = "";
m_lbTips->Caption = "请输入授权码并验证";
PostMessage(Application->MainFormHandle, UM_USERCONFIRM, UR_RESET, 0 );
m_btnOk->Caption = "关闭";
}
//---------------------------------------------------------------------------