C++Builder相談室 Part18
at TECH
782:デフォルトの名無しさん
08/06/02 19:25:16
URLリンク(delfusa.blog65.fc2.com)
のやり方でTMemoを継承して、SetWindowLongで追加できないES_CENTERを持つメモコンポーネントを作成したいのですが、
CreateParamsで設定したスタイルが反映されません。どこに問題があるのでしょうか?
class TMemoEx : public TMemo {
protected: void __fastcall CreateParams(TCreateParams& param);
public: __fastcall TMemoEx(TMemo* original);
};
--------↑ヘッダ--------↓ソースファイル---------------
__fastcall TForm1::TForm1(...) : TForm(...) {
Memo1 = new TMemoEx(Memo1);
}
void __fastcall TMemoEx::CreateParams(TCreateParams& param) {
param.Style = param.Style | ES_CENTER | ES_NUMBER;
TMemo::CreateParams(param);
}
__fastcall TMemoEx::TMemoEx(TMemo* original) : TMemo(original->Owner) {
Parent = original->Parent;
TMemoryStream* ms = new TMemoryStream();
try {
ms->WriteComponent(original);
delete original;
ms->Position = 0;
ms->ReadComponent(this);
} __finally {
delete ms;
}
SendMessage(Handle, ES_SETRECT, ....);
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5169日前に更新/190 KB
担当:undef