![]() |
Delphi-Version: 5
GetBitmap(3, TBitBtn.Glyph) direkt in Objekt geht nicht
Hallo zusammen,
in meiner Anwendung wird während eines Ablaufs in einem BitButton das Glyph geändert. Bisher war das so gelöst, dass dazu lauter TImages auf der Oberfläche lagen. Ich wollte die jetzt in einer ImageList sammeln und zuweisen. Das funktioniertz aber nur über Umwege:
Delphi-Quellcode:
Wenn ich die Buttons im TForm.Create mit
sButton := format('btAbs%d', [i]);
// Die ursprüngliche Lösung (hat funktioniert) TBitBtn(FindComponent(sButton)).Glyph := Image1.Picture.Bitmap; // Die gewollte Lösung, die aber nicht funktioniert ImageList1.GetBitmap(1, TBitBtn(FindComponent(sButton)).Glyph); // Der Workaround, der funktioniert BitMap1 := TBitMap.Create; ImageList1.GetBitmap(1, BitMap1); TBitBtn(FindComponent(sButton)).Glyph := BitMap1; BitMap1.Free;
Delphi-Quellcode:
initialisiere, funktioniert die Zuweisung. Von daher habe ich es schon mit Refresh probiert, aber das brachte nichts
for i := 1 to 10 do
begin sButton := format('btAbs%d', [i]); ImageList1.GetBitmap(4, TBitBtn(FindComponent(sButton)).Glyph); end; |
AW: GetBitmap(3, TBitBtn.Glyph) direkt in Objekt geht nicht
Zitat:
Delphi-Quellcode:
helfen.
TBitBtn(FindComponent(sButton)).Glyph.Modified := True;
|
AW: GetBitmap(3, TBitBtn.Glyph) direkt in Objekt geht nicht
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:14 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz