Autor Beitrag
Blackout
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 64



BeitragVerfasst: So 06.04.03 15:05 
hi leute,
wollte mal fragen ob es geht ein Button oder ein BMP auf ein TabControlreiter zu Zeichnen.

Ich würde gerne ein Schließen "X" ganz rechts auf jeden Reiter meines TabControls haben.

Danke schonmal im Vorraus

_________________
MfG Blackout
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Di 08.04.03 09:23 
Hallo,

schau Dir doch mal die Events an die Dir die Komponente tTabControl bietet. Darunter befindet sich auch das OnDrawTab-Event.

Gruß
Tino
Blackout Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 64



BeitragVerfasst: Di 08.04.03 18:46 
hehe so weit war ich auch schon :wink:

ich hab zur zeit nur das Problem den einzelnen Tabs Strings zuzuteilen

Das zeichnen funktioniert super:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.TabControl1DrawTab(Control: TCustomTabControl;
  TabIndex: Integer; const Rect: TRect; Active: Boolean);
begin

  If TabIndex = 0 Then
    Form1.TabControl1.Canvas.Draw(Rect.Left+2, Rect.Top+2, Form1.Image1.Picture.Bitmap);   

end;


Aber wenn ich dem Tab einen String zuteile flimmert das immer

_________________
MfG Blackout