Bonjour à tous,

Voila une fonction que je viens de créer pour ouvrir une fenêtre de message :

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
function Message2(Texte1,Texte2,Texte3,Texte4,Texte5)
% Boîte de message
 
%% Initialisation des variables   
if nargin == 0  
    Texte1 = 'Texte1';
    Texte2 = 'Texte1';
    Texte3 = '\bTexte1!';
    Texte4 = 'Texte1';
    Texte5 = 'Texte1';
end
 
Largeur = max(length(Texte1) * 8, 200);
 
global cdf;
 
%% Construction de la figure      
% et des objets de contrôle
figure(...
    'NumberTitle', 'off', ...
    'Name',        'STS UTE Stress', ...
    'MenuBar',     'none', ...
    'Resize',      'on', ...
    'Units',       'Pixels', ...
    'Position',    [0 0 Largeur 150], ...
    'Color',       cdf, ...
    'WindowStyle', 'modal', ...
    'Visible',     'off');
 
hOk = uicontrol(...
    'Style',    'pushbutton', ...
    'String',   'OK',...
    'Units',    'normalized', ...
    'CallBack', @Ok, ...
    'Position', [0.4 0.1 0.2 0.2]);
 
uicontrol(...
    'Style',      'text', ...
    'String',     Texte1,...
    'FontSize',   11, ...
    'FontWeight', 'bold', ...
    'Units',      'normalized', ...
    'CallBack',    @Oui, ...
    'Position',    [0 0.8 1 0.2]);
 
uicontrol(...
    'Style',      'text', ...
    'String',     Texte2,...
    'FontSize',   11, ...
    'FontWeight', 'bold', ...
    'Units',      'normalized', ...
    'CallBack',    @Oui, ...
    'Position',    [0 0.68 1 0.2]);
 
uicontrol(...
    'Style',      'text', ...
    'String',     Texte3,...
    'FontSize',   11, ...
    'FontWeight', 'bold', ...
    'Units',      'normalized', ...
    'CallBack',    @Oui, ...
    'Position',    [0 0.55 1 0.2]);
 
uicontrol(...
    'Style',      'text', ...
    'String',     Texte4,...
    'FontSize',   11, ...
    'FontWeight', 'bold', ...
    'Units',      'normalized', ...
    'CallBack',    @Oui, ...
    'Position',    [0 0.42 1 0.2]);
 
uicontrol(...
    'Style',      'text', ...
    'String',     Texte5,...
    'FontSize',   11, ...
    'FontWeight', 'bold', ...
    'Units',      'normalized', ...
    'CallBack',    @Oui, ...
    'Position',    [0 0.3 1 0.2]);
%% Finition de la figure          
movegui(gcf, 'center');
set(gcf, 'Visible', 'on');
uiwait(gcf);
set(gcf, 'WindowStyle', 'normal');
close(gcf);
 
%% Fonction CallBack              
function Ok(source, eventdata)
    uiresume(gcf);
end
 
end
Cependant j'aimerai savoir s'il est possible ou pas de surligner mon "Texte1" pour qu'il puisse apparaitre sur fond noir et être écris en blanc??

Merci pour votre aide

ps j'ai une autre question, qui est comment parvenir à mettre un texte en gras, j'ai lu qu'il me fallait utiliser la balise : \bf mais elle apparait dans ma figue quand le lance la fenêtre et le texte n'est pas en gras....