ControlSetText for Pictures

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Kapitano
Posts: 31
Joined: 07 Sep 2019, 10:58

ControlSetText for Pictures

07 Dec 2021, 10:04

I'm trying to program a simple slideshow. Here's the code:

Code: Select all

o_SlideShow := Gui("" , "SlideShow")
o_SlideShow.Add("Picture" , "Center W1280 H-1" , "")
o_SlideShow.Show("")
Loop
{
	Loop Files , "E:\SlideShow\*.jpg"
	{
		ControlSetText(a_LoopFileFullPath , "Picture1" , "SlideShow")
		Sleep(1000)
	}
}
I get the error message "Target control not found", for the ControlSetText line. Presumably "Picture1" is not the right way to refer to that control. What am I doing wrong?
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: ControlSetText for Pictures

07 Dec 2021, 12:05

The classNN is probably Static1. That said, you're better off doing something like:

Code: Select all

o_SlideShow := Gui("" , "SlideShow")
pic := o_SlideShow.Add("Picture" , "Center W1280 H-1" , "")
o_SlideShow.Show("")
Loop
{
	Loop Files , "E:\SlideShow\*.jpg"
	{
		pic.value := a_LoopFileFullPath
		Sleep(1000)
	}
}

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Draken, Sem552, songdg and 33 guests