質問編集履歴
2
プログラムを最新状況に修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,6 +26,18 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
+
【変更箇所】
|
30
|
+
|
31
|
+
回答をいただき,プログラムを次のように変更.下記のように修正したのですが,ボタンの色が変更せず,何も動作しなくて困っています.
|
32
|
+
|
33
|
+
1.FColorフィールド,Colorプロパティを削除してFBrushフィールド,Brushプロパティ,GetBrushメソッドを追加した.
|
34
|
+
|
35
|
+
2.TButtonクラスのpublicプロパティにBrushプロパティがあることが分かったので,1で追加したBrushフィールドやプロパティ,メソッドをコメント化した.
|
36
|
+
|
37
|
+
3.ClickCheckBoxClickイベントでBrushプロパティのColorプロパティを変更するように修正.
|
38
|
+
|
39
|
+
|
40
|
+
|
29
41
|
【開発環境】
|
30
42
|
|
31
43
|
OS:Windows10 64bit
|
@@ -106,7 +118,7 @@
|
|
106
118
|
|
107
119
|
{
|
108
120
|
|
109
|
-
DoorButton->Color = clRed;
|
121
|
+
DoorButton->Brush->Color = clRed;
|
110
122
|
|
111
123
|
}
|
112
124
|
|
@@ -114,7 +126,7 @@
|
|
114
126
|
|
115
127
|
{
|
116
128
|
|
117
|
-
DoorButton->Color = clBtnFace;
|
129
|
+
DoorButton->Brush->Color = clBtnFace;
|
118
130
|
|
119
131
|
}
|
120
132
|
|
@@ -254,31 +266,17 @@
|
|
254
266
|
|
255
267
|
//---------------------------------------------------------------------------
|
256
268
|
|
269
|
+
/*
|
270
|
+
|
257
|
-
|
271
|
+
TBrush* __fastcall TDoorButton::GetBrush()
|
258
|
-
|
272
|
+
|
259
|
-
{
|
273
|
+
{
|
260
|
-
|
261
|
-
|
274
|
+
|
262
|
-
|
263
|
-
{
|
264
|
-
|
265
|
-
FColor = value;
|
266
|
-
|
267
|
-
|
275
|
+
return Brush;
|
268
|
-
|
276
|
+
|
269
|
-
|
277
|
+
}
|
270
|
-
|
271
|
-
|
278
|
+
|
272
|
-
|
273
|
-
//---------------------------------------------------------------------------
|
274
|
-
|
275
|
-
TColor __fastcall TDoorButton::GetColor()
|
276
|
-
|
277
|
-
{
|
278
|
-
|
279
|
-
|
279
|
+
*/
|
280
|
-
|
281
|
-
}
|
282
280
|
|
283
281
|
//---------------------------------------------------------------------------
|
284
282
|
|
@@ -314,25 +312,25 @@
|
|
314
312
|
|
315
313
|
private:
|
316
314
|
|
317
|
-
TColor FColor;
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
315
|
+
// TBrush *FBrush;
|
322
|
-
|
316
|
+
|
317
|
+
|
318
|
+
|
323
|
-
T
|
319
|
+
// TBrush* __fastcall GetBrush();
|
324
320
|
|
325
321
|
|
326
322
|
|
327
323
|
protected:
|
328
324
|
|
325
|
+
// void __fastcall CreateParams(Controls::TCreateParams & Params);
|
326
|
+
|
329
327
|
public:
|
330
328
|
|
331
329
|
__fastcall TDoorButton(TComponent* Owner);
|
332
330
|
|
333
331
|
__published:
|
334
332
|
|
335
|
-
__property T
|
333
|
+
// __property TBrush *Brush = { read=GetBrush };
|
336
334
|
|
337
335
|
|
338
336
|
|
1
開発環境の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,6 +26,14 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
+
【開発環境】
|
30
|
+
|
31
|
+
OS:Windows10 64bit
|
32
|
+
|
33
|
+
C++Builder10.2 Community Edition
|
34
|
+
|
35
|
+
|
36
|
+
|
29
37
|
フォーム画面には
|
30
38
|
|
31
39
|
・ボタン(Name:Button1),パネル(Name:Panel1),チェックボックス(Name:ClickCheckBox)コンポーネントを張り付けています.
|