Hallo!
D2007
die User meiner Anwendung sollen per Änderung der Caption-Eigenschaft eines speziellen Tabs (fett/farbig) auf ein im Hintergrund auftretendes Ereignis aufmerksam gemacht werden.
Das klappt bei mir aber nur, wenn dieses Ereignis vor dem Start der Anwendung schon statt gefunden hat.
Ich weiß nämlich nicht, wie ich zwischendurch das Ereignis OnDrawTab auslösen und damit meine Caption ändern kann. Bei einem Wechsel des aktiven Tabsheets wird das Ereignis scheinbar nicht ausgelöst. Nur beim Programmstart und wenn man explizit auf den Reiter drückt.
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
| procedure TForm1.PageControl1DrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); begin if (TabIndex=6) and (vf.Count > 0) then begin Control.Canvas.FillRect(Rect); Control.Canvas.Font.Style := [fsBold]; Control.Canvas.Font.Color := clBlue; end else if (TabIndex=6) and (vf.Count = 0) then begin Control.Canvas.FillRect(Rect); Control.Canvas.Font.Style := []; Control.Canvas.Font.Color := clBlack; end; Control.Canvas.TextOut(rect.Left +4, rect.Top+4,TPageControl(Control).Pages[TabIndex].Caption); end; |
Hat jemand eine Idee oder kann mir vom Schlauch runterhelfen?
Oswald