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 :

[DELPHI 7] Affichage ToolBar + Button


Sujet :

Delphi

  1. #1
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2007
    Messages
    118
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2007
    Messages : 118
    Points : 89
    Points
    89
    Par défaut [DELPHI 7] Affichage ToolBar + Button
    bonjour

    mon pb est que le Ttoolbar ne s'affiche pas dans l'executable malgré qu'il est visible dans le code source.

    je voudrais aussi connaitre comment faire pour avoir les buttons de toolbar avec une couleur clBtnFace (pas blanche par default pour les buttons avec style XP)
    peut etre je doit utiliser d'autres composants que Bitbtn?
    sachant que j'utilse XPManifest pour avoir le style xp

    merci d'avance

  2. #2
    Membre régulier Avatar de gregcat
    Profil pro
    Inscrit en
    Décembre 2005
    Messages
    155
    Détails du profil
    Informations personnelles :
    Âge : 52
    Localisation : France

    Informations forums :
    Inscription : Décembre 2005
    Messages : 155
    Points : 94
    Points
    94
    Par défaut
    crées-tu l'objet toolbar dynamiquement ?

    si oui, n'oublie pas de mettre toolbar1.parent:=form1;

    sinon .. fait voir ton code ...

  3. #3
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2007
    Messages
    118
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2007
    Messages : 118
    Points : 89
    Points
    89
    Par défaut
    non le toolbar est crées automatiquement
    voila le code de form1 qui contient le toolbar :
    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
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    unit Unit1;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ComCtrls, ToolWin, ImgList, Menus, Buttons, XPMan,IniFiles;
     
    type
      TForm1 = class(TForm)
        MainMenu1: TMainMenu;
        Fichier1: TMenuItem;
        Ouvrir1: TMenuItem;
        N1: TMenuItem;
        Quiter1: TMenuItem;
        Edition1: TMenuItem;
        Copier1: TMenuItem;
        Configuration1: TMenuItem;
        Outils1: TMenuItem;
        Aide1: TMenuItem;
        StatusBar1: TStatusBar;
        ImageList1: TImageList;
        ToolBar1: TToolBar;
        ToolButton1: TToolButton;
        ToolButton5: TToolButton;
        Configurer1: TMenuItem;
        Compo1: TMenuItem;
        SpeedButton1: TSpeedButton;
        SpeedButton2: TSpeedButton;
        SpeedButton3: TSpeedButton;
        SpeedButton4: TSpeedButton;
        SpeedButton5: TSpeedButton;
        SpeedButton6: TSpeedButton;
        ListedesClients1: TMenuItem;
        Aide2: TMenuItem;
        ListedesComptes1: TMenuItem;
        ListeClientComptes1: TMenuItem;
        XPManifest1: TXPManifest;
        SpeedButton7: TSpeedButton;
        procedure SpeedButton1Click(Sender: TObject);
        procedure Quiter1Click(Sender: TObject);
        procedure OuvertureFiche(Class_Fiche: TFormClass);
        procedure SpeedButton2Click(Sender: TObject);
        procedure ListedesClients1Click(Sender: TObject);
        procedure Aide2Click(Sender: TObject);
        procedure SpeedButton3Click(Sender: TObject);
        procedure FormShow(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
     
    var
      Form1: TForm1;
       Passe,Asist : boolean;
       reper: string;
      ini:TIniFile;
    implementation
      Uses Unit2,Unit4,quickcli,apropos,Unit5,Unit6,Unit7,DMunit;
    {$R *.dfm}
     
    //la fonction d'ouverture des fiches
    procedure TForm1.OuvertureFiche(Class_Fiche: TFormClass);
    var
      Num_Fiche : integer;
      trouve_Fiche : Boolean;
    begin
      trouve_Fiche := false;
      Num_Fiche    := 0;
      while (Not trouve_Fiche) and (Num_Fiche<Screen.FormCount) do
      begin
        if (Screen.Forms[Num_Fiche] is Class_Fiche) then
        begin
           if Not (csDestroying in Screen.Forms[Num_Fiche].ComponentState) then
            Screen.Forms[Num_Fiche].Show;
            trouve_Fiche := true;
            break; 
        end;
        Inc(Num_Fiche);
      end;
     
      if Not trouve_Fiche then
        with Class_Fiche.Create(Self) do
           show;
    end;
     
     
     
     
     
     
    procedure TForm1.SpeedButton1Click(Sender: TObject);
    begin
    //Form2:=TForm2.Create(Form1); {création}
    //Form2.Show;
     OuvertureFiche(TForm2);
    end;
     
    procedure TForm1.Quiter1Click(Sender: TObject);
    begin
          application.Terminate;
    end;
     
     
    procedure TForm1.SpeedButton2Click(Sender: TObject);
    begin
      OuvertureFiche(TForm4);
    end;
     
    procedure TForm1.ListedesClients1Click(Sender: TObject);
    begin
    QuickReport5.Preview;
    end;
     
    procedure TForm1.Aide2Click(Sender: TObject);
    begin
    prop:=Tprop.Create(Form1); {création}
    prop.Show;
    end;
     
    procedure TForm1.SpeedButton3Click(Sender: TObject);
    begin
     Form7:=TForm7.Create(Form1); {création}
    Form7.Show;
    end;
     
     
    procedure TForm1.FormShow(Sender: TObject);
    begin
    ini:=TIniFile.Create(ExtractFilePath(Application.EXEName)+'SysInfo.ini');
    Passe :=ini.ReadBool('securite','mdp',true);
    Asist :=ini.ReadBool('securite','ast',true);
    ini.Free;
    //Asist:=true;
    //Passe:=false;
    if Asist then
       begin
            formAssist:=TformAssist.Create(Form1);
            formAssist.ShowModal
            //form1.Visible:=false;
       end
      else if Passe then
                       begin
                         FormPass:=TFormPass.Create(Form1);
                         FormPass.ShowModal
                      end
             else form1.Enabled:=true;
     
    end;
     
    end.
    en effet meme dans une simple form le toolbar est toujour invisible ,peut etre je doit utiliser ActionToolbar ,mais je ne v pas ça puisque ce dernier est utilisé seulement avec Windows XP !!
    y a il une autre solution ?

Discussions similaires

  1. Delphi 7 affichage de la langue arabe
    Par 21247692 dans le forum Bases de données
    Réponses: 15
    Dernier message: 25/02/2009, 13h54
  2. affichage de button.
    Par Minority dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 31/07/2007, 13h09
  3. Réponses: 4
    Dernier message: 31/03/2005, 08h48
  4. [Forms9i]Affichage toolbar
    Par Challenger dans le forum Forms
    Réponses: 10
    Dernier message: 16/05/2004, 14h43
  5. Toolbar Buttons et paramètres
    Par Lux interior dans le forum XMLRAD
    Réponses: 4
    Dernier message: 13/06/2003, 19h44

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