Jump to content

how to change image from list


Recommended Posts

CODE
#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("AForm1", 633, 447, 193, 115)

GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close")

GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1Minimize")

GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1Maximize")

GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1Restore")

$List1 = GUICtrlCreateList("", 8, 24, 177, 370)

GUICtrlSetData(-1, "GTA VICE CITY|SONIC HEROES|THE RAGE|VIRTUA TENNIS")

GUICtrlSetFont(-1, 16, 800, 2, "Palatino Linotype")

GUICtrlSetColor(-1, 0x800000)

GUICtrlSetOnEvent(-1, "AList1Click")

$Pic1 = GUICtrlCreatePic("", 200, 24, 417, 369, BitOR($SS_NOTIFY,$WS_GROUP))

GUICtrlSetOnEvent(-1, "APic1Click")

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

how to change image from list

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

how to change image from list plzzzz reply

post-24728-1185189602_thumb.jpg

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

I think your AList1Click() function should look something like this...

Func AList1Click()
    Switch GUICtrlRead(@GUI_CtrlId)
        Case "GTA VICE CITY"
            GUICtrlSetImage($Pic1, 'pic1.jpg')
        Case "SONIC HEROES"
            GUICtrlSetImage($Pic1, 'pic2.jpg')
        Case "THE RAGE"
            GUICtrlSetImage($Pic1, 'pic3.jpg')
        Case "VIRTUA TENNIS"
            GUICtrlSetImage($Pic1, 'pic4.jpg')
    EndSwitch
EndFunc

"be smart, drink your wine"

Link to comment
Share on other sites

i have some another question how to select a game when enter is pressed

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

CODE
#include <GUIConstants.au3>

HotKeySet("2", "up")

HotKeySet("8", "down")

Opt("GUIOnEventMode", 1)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("AForm1", 633, 447, 193, 115)

GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close")

GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1Minimize")

GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1Maximize")

GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1Restore")

$List1 = GUICtrlCreateList("", 0, 16, 153, 344)

GUICtrlSetData(-1, "GTA VICE CITY|SONIC HEROES|THE RAGE|VIRTUA TENNIS")

GUICtrlSetFont(-1, 14, 400, 0, "Palatino Linotype")

GUICtrlSetOnEvent(-1, "AList1Click")

$Pic1 = GUICtrlCreatePic("", 160, 16, 425, 361, BitOR($SS_NOTIFY,$WS_GROUP))

GUICtrlSetOnEvent(-1, "APic1Click")

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

Sleep(100)

WEnd

Func AForm1Close()

EndFunc

Func AForm1Maximize()

EndFunc

Func AForm1Minimize()

EndFunc

Func AForm1Restore()

EndFunc

Func AList1Click()

Switch GUICtrlRead(@GUI_CtrlId)

Case "GTA VICE CITY"

GUICtrlSetImage($Pic1, 'C:\pics\2.jpg')

Case "SONIC HEROES"

GUICtrlSetImage($Pic1, 'C:\pics\3.jpg')

Case "THE RAGE"

GUICtrlSetImage($Pic1, 'C:\pics\4.jpg')

Case "VIRTUA TENNIS"

GUICtrlSetImage($Pic1, 'C:\pics\1.jpg')

EndSwitch

EndFunc

Func APic1Click()

EndFunc

func up()

send("{up}")

EndFunc

Func Down()

Send("{down}")

EndFunc

i have some another question how to select a game when enter is pressed

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

how to run program from list. and program run with enter key plzzzzzzzzz help. :)

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

how and where i add run function with enter.

plzzzzzzzz help me yaar...!

CODE
#include <GUIConstants.au3>

HotKeySet("{numpad2}", "up")

HotKeySet("{numpad8}", "down")

Opt("GUIOnEventMode", 1)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("AForm1", 633, 447, 193, 115)

GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close")

GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1Minimize")

GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1Maximize")

GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1Restore")

$List1 = GUICtrlCreateList("", 0, 16, 153, 344)

GUICtrlSetData(-1, "GTA VICE CITY|SONIC HEROES|THE RAGE|VIRTUA TENNIS")

GUICtrlSetFont(-1, 14, 400, 0, "Palatino Linotype")

GUICtrlSetOnEvent(-1, "AList1Click")

$Pic1 = GUICtrlCreatePic("", 160, 16, 425, 361, BitOR($SS_NOTIFY,$WS_GROUP))

GUICtrlSetOnEvent(-1, "APic1Click")

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

Sleep(100)

WEnd

Func AForm1Close()

Exit 0

EndFunc

Func AForm1Maximize()

EndFunc

Func AForm1Minimize()

EndFunc

Func AForm1Restore()

EndFunc

Func AList1Click()

Switch GUICtrlRead(@GUI_CtrlId)

Case "GTA VICE CITY"

GUICtrlSetImage($Pic1, 'C:\pics\2.jpg')

Case "SONIC HEROES"

GUICtrlSetImage($Pic1, 'C:\pics\3.jpg')

Case "THE RAGE"

GUICtrlSetImage($Pic1, 'C:\pics\4.jpg')

Case "VIRTUA TENNIS"

GUICtrlSetImage($Pic1, 'C:\pics\1.jpg')

EndSwitch

EndFunc

Func APic1Click()

EndFunc

func up()

send("{up}")

EndFunc

Func Down()

Send("{down}")

EndFunc

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

Anyone plzzzz help.

How to run program from list with enter.

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

#include <GUIConstants.au3>

HotKeySet("{numpad2}", "up")
HotKeySet("{numpad8}", "down")
HotKeySet("{ENTER}", "Enter")

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 633, 447, 193, 115)
GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1Restore")
$List1 = GUICtrlCreateList("", 0, 16, 153, 344)
GUICtrlSetData(-1, "GTA VICE CITY|SONIC HEROES|THE RAGE|VIRTUA TENNIS")
GUICtrlSetFont(-1, 14, 400, 0, "Palatino Linotype")
GUICtrlSetOnEvent(-1, "AList1Click")
$Pic1 = GUICtrlCreatePic("", 160, 16, 425, 361, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetOnEvent(-1, "APic1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Sleep(100)
WEnd

Func AForm1Close()
Exit 0
EndFunc


Func AForm1Maximize()

EndFunc


Func AForm1Minimize()

EndFunc


Func AForm1Restore()

EndFunc


Func AList1Click()
Switch GUICtrlRead(@GUI_CtrlId)
Case "GTA VICE CITY"
GUICtrlSetImage($Pic1, 'C:\pics\2.jpg')
Case "SONIC HEROES"
GUICtrlSetImage($Pic1, 'C:\pics\3.jpg')
Case "THE RAGE"
GUICtrlSetImage($Pic1, 'C:\pics\4.jpg')
Case "VIRTUA TENNIS"
GUICtrlSetImage($Pic1, 'C:\pics\1.jpg')
EndSwitch
EndFunc


Func APic1Click()

EndFunc

func up()
send("{up}")
EndFunc

Func Down()
Send("{down}")
EndFunc

Func Enter()
    $game = GUICtrlRead($List1)
    If $game <> "" Then
        MsgBox(0, "Success", "You have chosen: " & $game)
    Else
        MsgBox(0, "Failure", "Please choose a game.")
    EndIf
EndFunc

Adapt it to fit your needs...

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...