Autor Beitrag
PeterKiers
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26


D7
BeitragVerfasst: Mo 08.08.05 18:18 
Hi Leute...

Hab einen treeview und ein PageControl mit 3 Sheets gemacht.

wie kann ich ein Treeview-node mit eine PageControl TabSheet kuppeln?

Vielen Dank für die Hilfe im vorraus

Viele Grüße,
Peter
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mo 08.08.05 18:19 
Was verstehst du unter kuppeln :gruebel:

AXMD
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Mo 08.08.05 18:39 
ausblenden Delphi-Quelltext
1:
MyNode.Data := tabSheet1;					
PeterKiers Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26


D7
BeitragVerfasst: Mo 08.08.05 18:51 
Was mach ich Falsch?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.TreeView1Click(Sender: TObject);
var
  MyNode: TTreeNode;
begin
  TreeView1.MyNode.Data := TabSheet1;
end;


Undeclared identifier 'myNode'.

P.

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
PeterKiers Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26


D7
BeitragVerfasst: Mo 08.08.05 19:22 
Stimmt noch nicht ganz aber es funktioniert.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.TreeView1Click(Sender: TObject); 
begin 
  TreeView1.items[0].StateIndex := 0; 
  PageControl1.ActivePageIndex := 0; 
end;


Peter

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 08.08.05 19:49 
Hallo,

es stimmt, das dass noch nicht ganz stimmt :wink:
Die Delphi-Hilfe sagt: Die Eigenschaft StateIndex gibt an, welches Bitmap ...

das funktioniert richtig (Delphi 3):
ausblenden Delphi-Quelltext
1:
PageControl1.ActivePage := PageControl1.Pages[TreeView1.Selected.AbsoluteIndex];					

wenn deine Tabsheets entsprechend der Reihenfolge der zugehörigen Einträge der TreeView angeordnet sind.

Es gibt aber eine Möglichkeit die Treeview mit einem PageControll über Node.Text und Pages[0].Caption zu verbinden. Dann spielt die Reihenfolge keine Rolle und es ist einfacher bei Änderungen die Angelegenheit zu warten.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
PeterKiers Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26


D7
BeitragVerfasst: Mo 08.08.05 20:08 
Es funktioniert...

Vielen Dank für die Hilfe.

Gruß
Peter