Jump to content
Sign in to follow this  
radienergos

buttonhover images question

Recommended Posts

radienergos

i want to make some images for buttons (one for normal state, one for mouse over and one if image is clicked) but because i don't want to create 30 or 40 images (3 images for 1 button) is there any way to use one image (like win xp styles or skins for firefox uses) ,which actually is the 3 images into one bigger, on a button ??

for example this

Posted Image

thanks in advance (and sorry for my english :P

Share this post


Link to post
Share on other sites
Madza91

I think is Valuater created this :P

#include <GUIConstants.au3>

$GUI = GUICreate("My GUI")
$ic = GUICtrlCreatePic("1.jpg",0,0,100,23)
GUICtrlSetState(-1, $GUI_DISABLE)
$b = GUICtrlCreatePic("2.jpg",0,0,100,23)
GUICtrlSetState(-1,$GUI_HIDE)
$2 =  GUICtrlCreatePic("3.jpg",0,0,100,23)
GUICtrlSetState(-1,$GUI_HIDE)

GUISetState()

While 1

    $m = GUIGetMsg()
   
    If $m = -3 then Exit
   
    $c = GUIGetCursorInfo($GUI)
    If $c[4] = $ic Then
        GUICtrlSetState( $b, $GUI_SHOW)
        GUICtrlSetState( $ic, $GUI_HIDE)
   ;Sleep(100)
        $c = GUIGetCursorInfo($GUI)
            While $c[4] = $b
                If GUIGetMsg() = $b Then Do_Function()
                $c = GUIGetCursorInfo($GUI)
            WEnd
        GUICtrlSetState( $2, $GUI_HIDE)
        GUICtrlSetState( $b, $GUI_HIDE)
        GUICtrlSetState( $ic, $GUI_SHOW)
    EndIf
WEnd

Func Do_Function()
    GUICtrlSetState( $2, $GUI_SHOW)
    MsgBox(0x0, "tset", "OK.....    ", 3)
EndFunc

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
radienergos

thanks for the reply

but in this example you use 3 jpgs for the events

im asking if is any way to use one image like this on my topic

okk i think that i must use Auto3Lib :P

Edited by radienergos

Share this post


Link to post
Share on other sites
Madza91

I don't know how to use buttons from one image but if you succeed send me pm :P


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
DirtDBaK

why does it have to be buttons why can't it be pictures with the $SS_NOTIFY on their style?


[center][/center]

Share this post


Link to post
Share on other sites
SmOke_N

I can see this being possible with a custom function and stretchbiblt... but I think it's more trouble than anyone is going to go through with alternative methods (separate pics) already out there.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  

×