Salut à tous,
Je voudrais afficher un TextField, que je créé en RunTime, et lui affecter un format en italique, et en gras.
je fais donc :
PREMIER ESSAI : METTRE UN TEXTE EN
ITALIQUE// Création du champ texte.
this.createTextField("champ",1,16,88,150,40);
// Définition du texte à afficher.
champ.text="BlaBlaBla";
// Création d'un format temporaire.
format=new TextFormat();
// Définition du format temporaire.
format.italic = true;
// Application du format temporaire au texte.
champ.setTextFormat(format);
===> Le résultat est celui attendu, le texte est en italique.
SECOND ESSAI : METTRE UN TEXTE EN
GRAS// Création du champ texte.
this.createTextField("champ",1,16,88,150,40);
// Définition du texte à afficher.
champ.text="BlaBlaBla";
// Création d'un format temporaire.
format=new TextFormat();
// Définition du format temporaire.
format.bold = true;
// Application du format temporaire au texte.
champ.setTextFormat(format);
===> Le résultat est celui attendu, le texte est en gras.
TROISIEME ESSAI : METTRE UN TEXTE EN
ITALIQUE ET
GRAS// Création du champ texte.
this.createTextField("champ",1,16,88,150,40);
// Définition du texte à afficher.
champ.text="BlaBlaBla";
// Création d'un format temporaire.
format=new TextFormat();
// Définition du format temporaire.
format.bold = true;
format.italic = true;
// Application du format temporaire au texte.
champ.setTextFormat(format);
===> Le résultat N'EST PAS celui attendu, le texte est JUSTE en italique.
Si quelqu'un a une idée sur le pourquoi du comment, je suis preneur!
Kazz