|
StringGrid를 상속받아서 클래스를 하나 만들었습니다.
그 클래스 안에 맴버 변수로 ComboBox를 하나 동적으로 생성해서 사용하고 있는데요
(당연히 StringGrid를 상속받은 클래스도 동적으로 생성해서 사용하구요)
이 ComboBox에 이벤트가 발생이 안되는것 같습니다.
class CVclProperty : public TStringGrid
{
public:
__fastcall CVclProperty(_in TComponent* Owner);
__published:
void __fastcall onDrawCell(_in TObject *Sender, _in int ACol, _in int ARow,
_in TRect &Rect, _in TGridDrawState State);
TComboBox *cbBox;
void __fastcall onComboSelect(TObject *Sender);
};
---구현부---
__fastcall CVclProperty::CVclProperty(_in TComponent* Owner) : TStringGrid(Owner)
{
OnDrawCell = (TDrawCellEvent)&onDrawCell; //이 함수는 잘 동작합니다.
cbBox = new TComboBox(this);
cbBox->Parent = this;
cbBox->Visible = false;
cbBox->OnSelect = onComboSelect; //이 함수는 동작 하지 않습니다.
}
void __fastcall CVclProperty::onDrawCell(_in TObject *Sender, _in int ACol, _in int ARow,
_in TRect &Rect, _in TGridDrawState State)
{
//<--이곳으로 들어옵니다.
}
void __fastcall CVclProperty::onComboSelect(TObject *Sender)
{
MessageBox(NULL, "", "xxx", MB_OK); //이곳으로 들어오지 않습니다.
}
고수님들의 도움이 필요합니다... 도와주세요~~~
|