Form在最小化最大化的時候回應什么訊息,本來以為OnResize,但是沒有反應啊。
求解答,求解脫!
uj5u.com熱心網友回復:
--頭檔案
class TForm12 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
void __fastcall mycomd(TMessage& Message);
public: // User declarations
__fastcall TForm12(TComponent* Owner);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_SYSCOMMAND,TMessage,mycomd)
END_MESSAGE_MAP(TForm)
};
----cpp
void __fastcall TForm12::mycomd(TMessage& Message)
{
if (Message.Msg == WM_SYSCOMMAND && Message.WParam == SC_MAXIMIZE)
{
ShowMessage("max");
}
else if (Message.Msg == WM_SYSCOMMAND && Message.WParam == SC_MINIMIZE)
{
ShowMessage("min");
}
TForm::Dispatch(&Message);
}
uj5u.com熱心網友回復:
void __fastcall TForm12::mycomd(TMessage& Message)
{
if (Message.WParam == SC_MAXIMIZE)
{
ShowMessage("max");
}
else if (Message.WParam == SC_MINIMIZE)
{
ShowMessage("min");
}
TForm::Dispatch(&Message);
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/117216.html
標籤:VCL組件使用和開發
上一篇:11.DRF-權限
下一篇:有誰做過RBPF啊?
