例:
//--------------------------------------------------------------------------- void __fastcall SetCheckBoxState(TCheckBox* ACheckBox, TCheckBoxState AState) { switch(AState) { case cbChecked: SendMessage(ACheckBox->Handle, BM_SETCHECK, BST_CHECKED, 0); break; case cbUnchecked: SendMessage(ACheckBox->Handle, BM_SETCHECK, BST_UNCHECKED, 0); break; case cbGrayed: SendMessage(ACheckBox->Handle, BM_SETCHECK, BST_INDETERMINATE, 0); break; } } //---------------------------------------------------------------------------