Autor Beitrag
FloFri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 97



BeitragVerfasst: So 28.09.03 21:29 
Hi!
Ich habe da mal wieder eine Frage zu MDI:

Wie kann ich ein bestimmtes MDI-Child per buttonklick in den Fordergrund bringen? So wie das auch quasi bei der Taskleiste in Windows ist, wenn man da auf einen der buttons klickt.

MfG
FloFri
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 29.09.03 07:03 
ausblenden Delphi-Quelltext
1:
mdiform.BringToFront;					
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 29.09.03 08:45 
ausblenden Delphi-Quelltext
1:
MainForm.ActiveMDIChild := MDIForm;					

Gruß
Tino
FloFri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 97



BeitragVerfasst: Mo 29.09.03 12:45 
@Ugrohe: Funktioniert nicht, ändert sich nix.

@Tino: Geht auch nicht, das ist eine Nur-Lesen Eigenschaft
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 29.09.03 13:04 
Ach so... stimmt ja :oops:

Aber so sollte es funktionieren:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
SendMessage (
     tForm (Application.MainForm).ClientHandle, 
     WM_MDIACTIVATE, 
     ChildForm.Handle, 0
  );

Gruß
TINO
FloFri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 97



BeitragVerfasst: Mo 29.09.03 13:56 
Hm... Will auch nicht :(
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 29.09.03 14:01 
Also bei mir funktioniert es!
FloFri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 97



BeitragVerfasst: Mo 29.09.03 14:22 
Ah, jetzt hats gefunzt, ist nur etwas komisch, ich hole mir immer das handle der childform, die ich habe will durch das MDIChildren-Array der Parent Form. Scheinbar ändert sich da der Index der Forms, je nach dem, welches Oben ist, weil der immer hin und her schaltet, obwohl ich immer den handle vom index 1 nehme. beim index 0 geht gar nix.
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Mo 29.09.03 16:00 
Das ist korrekt. Die MDI-Childs liegen in der Reihenfolge ihrer Aktivierung in diesem Array.

barfuesser
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 29.09.03 17:56 
Hmm, also mein Code funktioniert bei mir, hab das in einem meiner Projekte so drin *grübel*
FloFri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 97



BeitragVerfasst: Mo 29.09.03 18:31 
@Ugrohe: dein code wird wohl auch funktionieren, nachdem ich jetzt weis, wie das array sich zusammensetzt. Ich habe naehmlich immer versucht das mdi-child mit dem index 0 nach vorne zu bringen :D

Ich werde es morgen mal testen, wenn ich den code wieder vor mir habe.