Bonsoir,
Je souhaiterais trouver un moyen plus facile pour selectionner un élément d'une listbox et le mettre en tant que font à un richEdit. Mon programme marche mais c'est pas top au niveau programmation, je pense qu'il y a un autre moyen notamment avec ListBox1.Items mais aprés j'ai un problème avec RichEdit2.Font.Name qui veut un string et non un Tstrings.Je ne sais pas comment faire.
Merci
Boober.
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 procedure TForm1.ListBox1Click(Sender: TObject); begin elemSelection := ListBox1.ItemIndex; if elemSelection =0 then begin RichEdit2.Font.Name := 'Amandine'; end; if elemSelection =1 then begin RichEdit2.Font.Name := 'Bernard'; end; if elemSelection =2 then begin RichEdit2.Font.Name := 'Georges'; end; if elemSelection =3 then begin RichEdit2.Font.Name := 'Michelle'; end; end;
Partager