silverman
Nombre de messages : 968 Age : 51 Localisation : Picardie Date d'inscription : 18/03/2015
| Sujet: couleur d'un progress_bar Dim 30 Oct 2016 - 13:31 | |
| Bonjour à tous! 'color' ne permet pas de changer la couleur de la barre d'un objet 'progress_bar', voici une sub autonome pour effectuer cet oubli - Code:
-
' colorer la barre de l'objet 'progress_bar'
progress_bar 1:left 1,5:width 1,200 color_progress_bar(1,255,0,255) :' mauve position 1,50 progress_bar 2:left 2,5:width 2,200:top 2,100 color_progress_bar(2,255,0,0) :' rouge position 2,50
END sub COLOR_PROGRESS_BAR(nb%,r%,g%,b%) dim_local i,j,k%,my_library$,my_dll$,found% ' verifie si "user32" existe: my_dll$="user32" ' i=0 k%=0 found%=0 my_dll$=lower$(my_dll$) j=instr(my_dll$,".") : if j>0 then my_dll$=left$(my_dll$,j-1) ' repeat k%=k%+1 until library$(k%)="_"
repeat i=i+1 my_library$=lower$(library$(i)) j=instr(my_library$,".") : if j>0 then my_library$=left$(my_library$,j-1) ' if my_library$=my_dll$ found%=1 exit_repeat end_if until i=32 ' ' charge la librairie et cré la commande si nécessaire if found%=0 library k%,my_dll$ ' print k%," : not found ",library$(k%) :' debug command "pb_color","SendMessageA",k%,"IIII","stdcall" else ' print i," : found ",library$(i) :' debug end_if ' ' colore la progress_bar pb_color handle(nb%),1033,0,(b%*65536)+(g%*256)+r% end_sub | |
|
Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Dim 30 Oct 2016 - 16:03 | |
| Je prends ! et je mets cela dans ma subothèque. Merci Silverman. | |
|
JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: couleur d'un progress_bar Mar 1 Nov 2016 - 20:41 | |
| Astucieux, et ça marche ! même si je n'ai pas tout compris... Et bel exemple d'utilisation des nouveaux mots-clés panoramic (Library, Command...) | |
|
Contenu sponsorisé
| Sujet: Re: couleur d'un progress_bar | |
| |
|