Bonjour,
Tout nouveau dans le PureBasic (1 jours ),
je ne comprend pas très bien l'aide et je voudrais savoir si c'était possible de mettre du texte en gras/italique/bleu...?
Comment ? puis-je avoir un exemple ?
merci d'avance
Police/Caractère : Comment mettre en Gras , couleur etc...?
salut,
@++
Code : Tout sélectionner
;- Window Constants
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
Enumeration
#Text_0
EndEnumeration
FontID5 = LoadFont(5, "Comic Sans MS", 12, #PB_Font_Bold | #PB_Font_Italic); ici ont choisis la police, taille et gras
If OpenWindow(#Window_0, 216, 0, 600, 300, "New window ( 0 )", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
If CreateGadgetList(WindowID(#Window_0))
TextGadget(#Text_0, 5, 110, 580, 30, "Salut Shinao recherche sur le forum il y a plein de tuto dessus", #PB_Text_Center); ici ont place notre texte dans la fenetre
SetGadgetFont(#Text_0, FontID5); avec cette option ont change les caractere du texte précedament cree ligne 11 grace a FontID5
SetGadgetColor(#Text_0, #PB_Gadget_FrontColor, RGB(0,0,255)); la ont modifie la couleur du texte avec rgb = rouge, vert, bleu
EndIf
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadget()
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
@++
Windows 10 x64, PureBasic 5.73 x86 & x64
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
Re: Police/Caractère : Comment mettre en Gras , couleur etc.
Bonjour,
Comment faire alors pour :
après avoir passé le composant en gras, le repasser en normal ?
2ème question : Y a t-il un moyen de typer le style des textes pour tous par defaut ?
Merci d'avance
Comment faire alors pour :
après avoir passé le composant en gras, le repasser en normal ?
2ème question : Y a t-il un moyen de typer le style des textes pour tous par defaut ?
Merci d'avance
Agence web https://www.atoneo.com
Bougie personnalisée https://www.bougie-personnalisee.fr
Fabrication bougie https://www.fabricant-bougie.fr
Avis externalisés https://satisfactions-clients.com
Ecommerçants Alsaciens https://www.alsazon.shop
Bougie personnalisée https://www.bougie-personnalisee.fr
Fabrication bougie https://www.fabricant-bougie.fr
Avis externalisés https://satisfactions-clients.com
Ecommerçants Alsaciens https://www.alsazon.shop
- falsam
- Messages : 7324
- Inscription : dim. 22/août/2010 15:24
- Localisation : IDF (Yvelines)
- Contact :
Re: Police/Caractère : Comment mettre en Gras , couleur etc.
Affecter une police à l'ensemble de l'application
Code : Tout sélectionner
Enumeration
#FontApp
#MainForm
#Nom
#Email
#Button
EndEnumeration
Procedure MainFormShow()
OpenWindow(#MainForm,0,0,400,300,"Nouvelle application",#PB_Window_ScreenCentered | #PB_Window_SystemMenu)
LoadFont(#FontApp,"Arial",14) ; C'est tres gros mais c'est juste pour l'exemple
SetGadgetFont(#PB_Default,FontID(#FontApp))
TextGadget(#PB_Any, 20,20,80,20,"Nom")
StringGadget(#Nom,100,20,150,24,"")
TextGadget(#PB_Any, 20,50,80,20,"Email")
StringGadget(#Email,100,50,150,24,"")
ButtonGadget(#Button,300,50,80,24,"Ok")
EndProcedure
MainFormShow()
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
Configuration : Windows 11 Famille 64-bit - PB 6.20 x64 - AMD Ryzen 7 - 16 GO RAM
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%