Mettre une fiche dans un panel

develomagaly Messages postés 46 Date d'inscription mercredi 5 octobre 2005 Statut Membre Dernière intervention 3 mai 2006 - 18 nov. 2005 à 15:14
develomagaly Messages postés 46 Date d'inscription mercredi 5 octobre 2005 Statut Membre Dernière intervention 3 mai 2006 - 21 nov. 2005 à 09:33
bonjour,
J'ai un petit probleme pour mettre une fiche dans un panel.
J'ouvre une fentre FrmSimulation qui contient a panel PnlDonnees
Je met dans PnlDonnees la fiche FrmFoyMen
La fiche FrmFoyMen contient elle aussi un panel PnlFoy
Et je voudrait mettre Une fiche FrmFoySit dans PnlFoy

Voici comment je procede :
windows.SetParent(FrmFoyMen.Handle,FrmSimulation.PnlDonnees.Handle);

// Doit afficher la fenetre dans le panel de la fenetre FrmFoyMen
windows.SetParent(FrmFoySIt.Handle,FrmFoyMen.PnlFoy.Handle);

Alors je retrouve bien FrmFoyMen Dans le panel de FrmSimulation
Mais je ne retrouve pas FrmFoySit Dans le panel de FrmFoyMen
Comment doi-je faire?

2 réponses

cs_ManChesTer Messages postés 374 Date d'inscription vendredi 20 octobre 2000 Statut Modérateur Dernière intervention 15 janvier 2021
18 nov. 2005 à 17:41
Un ptit code vaut miex qu'un long dicourt :

Type TFormPan = Class(Tpanel)
MyForm : TForm
end;

var FrmPan : TFormPan = Nil;
FrmPan1 : TFormPan = Nil;

procedure TForm1.Button1Click(Sender: TObject);
begin
If FrmPan<>Nil then
FreeAndNil(FrmPan)
else
begin
FrmPan:=TFormPan.Create(SELF);
FrmPan.ParentWindow:=Form1.Handle;
FrmPan.SetBounds(ClientRect.Left,ClientRect.Top,ClientWidth,ClientHeight);
FrmPan.MyForm:=Tform.Create(FrmPan);
FrmPan.MyForm.ParentWindow:=FrmPan.Handle;
FrmPan.MyForm.Show;
FrmPan.Show;

FrmPan1:=TFormPan.Create(FrmPan);
FrmPan1.ParentWindow:=FrmPan.MyForm.Handle;
FrmPan1.SetBounds(FrmPan.MyForm.ClientRect.Left,FrmPan.MyForm.ClientRect.Top,
FrmPan.MyForm.ClientWidth,FrmPan.MyForm.ClientHeight);
FrmPan1.MyForm:=Tform.Create(FrmPan1);
FrmPan1.MyForm.ParentWindow:=FrmPan1.Handle;
FrmPan1.MyForm.Show;
FrmPan1.Show;
end;

Bon Coding....

ManChesTer.
0
develomagaly Messages postés 46 Date d'inscription mercredi 5 octobre 2005 Statut Membre Dernière intervention 3 mai 2006
21 nov. 2005 à 09:33
je te remercie beaucoup car maintenant sa marche !
J'ai encore une petite question pour la route,
Je voudrait pouvoir afficher un ascenseur sur la derniere fiche que j'ajoute donc FrmPan1 . je met donc les proporiétés de FrmPan1 avec autoscroll:=true; mais sa ne fait rien
Je l'ai mit aussi dans mon code mais sa ne marche pas non plus ( erreur a la compilation)
Comme puis je faire ?
0
Rejoignez-nous