目次に戻る
一覧ページに戻る
CPEditBox::GetBackgroundColor
2001/12/20 update.
背景色を取得します。

書式

  unsigned long GetBackgroundColor();

パラメータ


戻り値
エディットボックスの背景色を取得します。
CP_RGBと同じ形式で格納されています。

解説


エディットボックスの背景色を取得します。
各RGB成分に分解する場合は、「CP_RGB_RED / CP_RGB_GREEN / CP_RGB_BLUE」マクロを使用してください。





ウィンドウ(ダイアログ)を生成して、その中にエディットボックスを配置します。

CPWindow win;
CPEditBox ebox;
unsigned long col;
int rr,gg,bb;

//ダイアログを生成する
win.Clear();
win.CreateNewDialog("TestDialog",120,120,300,200);

//エディットボックスの位置・サイズを指定
ebox.SetBounds(10,10,120,20);

//エディットボックスの文字列を指定
ebox.SetText("EditBox");

//エディットボックスの背景色を設定
ebox.SetBackgroundColor(CP_RGB(32,64,128));

//エディットボックスをCPWindowに結びつける
win.Add(&ebox);

//背景色を取得
col=ebox.GetBackgroundColor();
rr=CP_RGB_RED(col);
gg=CP_RGB_GREEN(col);
bb=CP_RGB_BLUE(col);

この例では、「rr=32 / gg=64 / bb=128」が入ります。


ビルド時に必要なファイル


ライブラリ :CPartsLib.lib (Macintoshの場合は、CPartsCW.a)
ヘッダ :CPEditBox.h


関連リンク


CPEditBoxクラス
CPEditBox::GetForegroundColor
CPEditBox::SetForegroundColor
CPEditBox::SetBackgroundColor