IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 Delphi Discussion :

Probleme pour moi


Sujet :

Delphi

  1. #1
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut Probleme pour moi
    Bonjour,
    J'ai cette Uni. Je veux utiliser moins de lignes, l'icône mise en place.
    Fichiers attachés Fichiers attachés

  2. #2
    Membre habitué Avatar de kanzarih
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Novembre 2002
    Messages
    327
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Novembre 2002
    Messages : 327
    Points : 197
    Points
    197
    Par défaut
    Bonjour,

    Essaye d'ajouter cette procedure :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
     
    procedure do_work(val:string);
    var myini : TIniFile;
    myIcon: TIcon;
    rasp: string;
    Filter: Word;
    begin
      Filter:= 0;
      myIcon:= TIcon.Create;
      myini:=TIniFile.Create(ExtractFilePath(Application.EXEName) + 'Micoane.ini');
      rasp:=myini.ReadString('Default',val, '');
      myicon.Handle:= ExtractAssociatedIcon(hInstance, PChar(rasp), Filter);
      val.Picture.Icon:= myIcon;
      val.Hint:=ExtractFileName(rasp);
      val.ShowHint:=True;
      myIcon.Free;
      myini.Free;
    end;
    ton "TForm1.FormShow" devient alors :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    procedure TForm1.FormShow(Sender: TObject);
    begin
     
      for i:=1 to 89 do
       begin
        do_work('img'+i);
       end;
     
    end;
    Bon Codage

  3. #3
    Membre expert
    Avatar de Charly910
    Homme Profil pro
    Ingénieur TP
    Inscrit en
    Décembre 2006
    Messages
    2 374
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur TP
    Secteur : Bâtiment Travaux Publics

    Informations forums :
    Inscription : Décembre 2006
    Messages : 2 374
    Points : 3 152
    Points
    3 152
    Par défaut
    Bonjour,

    @Kanzarih :

    en ligne 7 tu veux dire :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
       do_work('img'+IntToStr(i));
    A+

    Charly

  4. #4
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut
    Bonjour,
    Procédure do_work(val:string); doit être écrit 89 fois?
    FormShow procédure ne fonctionne pas à PageControl avec plus tabsheet

  5. #5
    Membre habitué Avatar de kanzarih
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Novembre 2002
    Messages
    327
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Novembre 2002
    Messages : 327
    Points : 197
    Points
    197
    Par défaut
    Bonjour Charly910,
    Effectivement

    Lia : Explique un peut! la procédure est utilisé dans une boucle "for" de 1 à 89! donc elle sera exécuté 89 fois.

  6. #6
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut
    Une erreur. Est-ce la vraie Unit.
    Fichiers attachés Fichiers attachés

  7. #7
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut
    Image de l'application
    Images attachées Images attachées  

  8. #8
    Rédacteur/Modérateur

    Avatar de SergioMaster
    Homme Profil pro
    Développeur informatique retraité
    Inscrit en
    Janvier 2007
    Messages
    15 115
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15 115
    Points : 41 246
    Points
    41 246
    Billets dans le blog
    63
    Par défaut
    Je pense que quelque chose comme ceci devrait fonctionner (non testé) , j'ai juste ajouté une boucle et un FindComponent

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    procedure TForm1.FormShow(Sender: TObject);
    var icolist: TStringList;
        i : word;
        Img : TImage; 
    begin
      icolist:=TStringList.Create;
      try
      icolist.LoadFromFile(ExtractFilePath(Application.ExeName) +'icofile.sav');
      for i:=1 to 89 do
       begin 
         Img:=TImage(FindComponent('Img'+inttostr(i))); 
         img.Picture.LoadFromFile(icolist.Strings[i-1]);
         img.Hint:=ChangeFileExt(ExtractFileName(icolist.Strings[i-1]),'');
       end;  
      finally
      icolist.Free;
      end;
    end;

  9. #9
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut
    M. SergioMaster,
    J'ai essaye, et parfait.

    Peut-être. comment passer une path icône dans iconfile,sav

  10. #10
    Rédacteur/Modérateur

    Avatar de SergioMaster
    Homme Profil pro
    Développeur informatique retraité
    Inscrit en
    Janvier 2007
    Messages
    15 115
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15 115
    Points : 41 246
    Points
    41 246
    Billets dans le blog
    63
    Par défaut
    Citation Envoyé par Lia Mircea Voir le message
    Peut-être. comment passer une path icône dans iconfile,sav
    Je ne comprends pas la question

  11. #11
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut
    Voici un .pas:

    procedure TForm1.btn6Click(Sender: TObject);

    ne functionne pas.
    Fichiers attachés Fichiers attachés

  12. #12
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut
    Image de programme.
    Botton OK Copiaza Icoana. Ne fonctionne pas
    Images attachées Images attachées  

  13. #13
    Expert éminent sénior
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    13 586
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 13 586
    Points : 25 262
    Points
    25 262
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    F.Strings[i]:=edt2.Text;
    , cela ne provoquerait pas une Indice Hors Limite ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    idx = F.Add(edt2.Text);
    if idx >= 0 then
      ShowMessage(F[idx]);
    Sinon, je ne vois pas à quoi c'est ce code, tu crée une liste, tu ajoutes un élement puis tu libère la liste, étrange

  14. #14
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut
    Toute la procédure TForm1.btn6Click(Sender: TObject); doivent être supprimé, est erroné. Vouloir un pour copie Edit.Text en Icofile.sav
    Parfois, mettre des messages, pour voir où le programme a été.

  15. #15
    Rédacteur/Modérateur

    Avatar de SergioMaster
    Homme Profil pro
    Développeur informatique retraité
    Inscrit en
    Janvier 2007
    Messages
    15 115
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15 115
    Points : 41 246
    Points
    41 246
    Billets dans le blog
    63
    Par défaut
    Si i est ok , alors je pense que la demande c'est de sauvegarder le nouvel intitulé , donc faire un SaveToFile
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    procedure TForm1.btn6Click(Sender: TObject);
    var
      F: TStringList;
     i: Integer;
    begin
       i:=cbb2.ItemIndex;
    //   Clipboard.AsText:=edt2.Text; // inutile
       F:=TStringList.Create;
      try
         F.LoadFromFile(ExtractFilePath(Application.ExeName) + 'icofile.sav');
         F.Strings[i]:=edt2.Text;
         F.SaveToFile(ExtractFilePath(Application.ExeName) + 'icofile.sav');
      finally
         F.Free;
       end;
    end;

  16. #16
    Nouveau Candidat au Club
    Femme Profil pro
    service a domicile
    Inscrit en
    Novembre 2012
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Roumanie

    Informations professionnelles :
    Activité : service a domicile
    Secteur : Services à domicile

    Informations forums :
    Inscription : Novembre 2012
    Messages : 15
    Points : 0
    Points
    0
    Par défaut
    Bonjour,
    M. SergioMaster, J'ai essaye, et parfait.
    Merci.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. un petit probleme pour vous un grand pour moi
    Par forstyle dans le forum Réseau
    Réponses: 6
    Dernier message: 04/11/2009, 20h03
  2. Réponses: 9
    Dernier message: 08/08/2009, 23h32
  3. Réponses: 2
    Dernier message: 30/05/2009, 14h04
  4. Un Grand Problem pour moi - Delphi & Anglais
    Par pierrefrench dans le forum EDI
    Réponses: 6
    Dernier message: 20/02/2006, 09h43

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo