Ajout d'un composant

hammadiest Messages postés 8 Date d'inscription jeudi 5 mars 2009 Statut Membre Dernière intervention 29 mai 2010 - 26 mai 2010 à 13:50
hammadiest Messages postés 8 Date d'inscription jeudi 5 mars 2009 Statut Membre Dernière intervention 29 mai 2010 - 29 mai 2010 à 01:03
salut
voila un code qui fait l'ajout d'un composant
var
  NewLabel: TLabel;
begin
    NewLabel := TLabel.Create(self);
    NewLabel.Parent := self;
    NewLabel.Top := 20;  /
    NewLabel.Left :=20 * 20;
    NewLabel.Caption := تختار اسم الCaption
  end;

end;  

mais si je ferme l'execution et je le lance une autre fois je ne trouve pas ce composant.
merci d'avant.























tv shows

3 réponses

hammadiest Messages postés 8 Date d'inscription jeudi 5 mars 2009 Statut Membre Dernière intervention 29 mai 2010
26 mai 2010 à 13:52
comment faire enregistrer se composant























п�ПЎвОжеМОе �ай�а �еМа
0
cleecky Messages postés 49 Date d'inscription mercredi 19 mai 2010 Statut Membre Dernière intervention 30 mars 2011
26 mai 2010 à 14:17
bonjour !
Je n'en sait absolument rien mais a tout hasard...
http://fdeport.free.fr/creationcomposant.htm
http://www.jcolibri.com/articles/prog_objet_composants/ecriture_de_composant/ecriture_de_composant.html#creation_de_composant

Si t'as pas déjà fait un tour sur ceux là....


i'm a newbieeees
0
hammadiest Messages postés 8 Date d'inscription jeudi 5 mars 2009 Statut Membre Dernière intervention 29 mai 2010
29 mai 2010 à 01:03
salut
j'ai trouver ces deux procedure mais le procedure load ne fonctionne pas sil vous plait expliquer mois comment fonctionne se deux procedure
procedure SaveLabel(Res: TLabel; aName: String);
Begin

  Try
    WriteComponentResFile(ExtractFilePath(ParamStr(0))+aName, Res);
  Except
    MessageBox(Application.Handle, 'Cannot saving the component !', 'Error', $10);
  end;
end;

Procedure LoadLabel(var aLabel: TLabel; aName: String);
var
  Str: String;
Begin
  Try
    Str := ExtractFilePath(ParamStr(0))+aName;
    aLabel := ReadComponentResFile(Str, aLabel) as TLabel;
  Except
    MessageBox(Application.Handle, 'Cannot loading the component !', 'Error', $10);
  end;
end;


pour l'enregistrement
SaveLabel(Label1, 'Label.dat');


pour l'appel
LoadLabel(Label1, 'Label.dat');


il faut indiquer que label1 est cree et enregistrer dans le fichier label.dat

et merci d'avance
0
Rejoignez-nous