Sign in to follow this  
Followers 0
Vindicator209

Labels changing color (not completely!)

3 posts in this topic

Ok, well, I was going to make a progressbar-like thing where there would be a blue text against a gray progress background, and the progress foreground would be blue, now i wanted to make the label so that once the blue progress made its way pas a part of the label, that part of the label would become grey(thus still readable)

I'm not sure if it's possible, but I figured I'd ask anyway, for future reference. Of course, all this could be avoided by simply making the label red or something in the first place, but what ever.


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Ok, well, I was going to make a progressbar-like thing where there would be a blue text against a gray progress background, and the progress foreground would be blue, now i wanted to make the label so that once the blue progress made its way pas a part of the label, that part of the label would become grey(thus still readable)

I'm not sure if it's possible, but I figured I'd ask anyway, for future reference. Of course, all this could be avoided by simply making the label red or something in the first place, but what ever.

This is something like it maybe with just 2 labels.

#include <GUIConstants.au3>


Const $WS_EX_COMPOSITED = 0x2000000
$Form3 = GUICreate("Form3", 413, 298, 303, 219, -1, $WS_EX_COMPOSITED)
$Label1 = GUICtrlCreateLabel("progress-state-so-far", 50, 100, 0, 17)
GUICtrlSetColor(-1, 0xbbbb00)
GUICtrlSetBkColor(-1, 0xff0000);
$Label2 = GUICtrlCreateLabel("progress-state-so-far", 50, 100, 100, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x808080)
$but1 = GUICtrlCreateButton('GO',100,150,70,22)
GUISetState(@SW_SHOW)



While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $but1
            go()
    EndSwitch
WEnd

Func go()
    For $n = 0 To 100
    ControlMove($Form3, '', $Label1, 50, 100, $n, 17)
    Sleep(50)
Next
For $n = 100 To 0 Step -1
    ControlMove($Form3, '', $Label1, 50, 100, $n, 17)
    Sleep(50)
Next
EndFunc
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

:0

I should have thought of that.. well this was a big ass DUH on my part... lol thanks


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0