DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: Little help with this code  (Read 5,897 times)

Candle

  • Participant
  • Joined in 2006
  • *
  • Posts: 18
IDEA: Little help with this code
« on: December 24, 2006, 03:08 PM »
I can't seem to get the buttons to work?

Code
Gui,2: Add, ListBox, x0 y0 w343 h500,
Gui,2: Show, x131 y91 h562 w561, New GUI Window
Gui,2: Add, Picture, x376 y140 w160 h390 , banner.jpg
Gui,2: Add, Button, x376 y90 w160 h30 , Save to File
Gui,2: Add, Button, x376 y30 w160 h30 , Select Folder
; Generated using SmartGUI Creator 4.0

Return

buttonselectfolder:
FileSelectFolder, OutputVar, , 3
if OutputVar =
    MsgBox, You didn't select a folder.
else
    MsgBox, You selected folder "%OutputVar%".

 Loop, "%OutputVar%"\*.mp3, 0, 1
{
   Pic%A_Index% = %A_LoopFileFullPath%
   If A_Index = 1
     GUIControl,2:, ListBox1, |%A_LoopFileName%||
   Else
    GUIControl,2:,ListBox1,%A_LoopFileName%
}
Return
GuiClose:
ExitApp

Thanks for any help with this.

edit by brotherS: If you don't say anything about your code (so that newbies can follow) it might be better to post @ the AHK forums directly.
« Last Edit: December 25, 2006, 03:24 PM by brotherS »

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: Little help with this code
« Reply #1 on: December 25, 2006, 12:17 AM »
:) To make a button do anything, you have to add a G<procedure_to_go_to> to the options.

Code
Gui,Add,Button,GJUMPHERE,Click Me!
Gui,Show,w200 h200
Return

JUMPHERE:
MsgBox,Clicked!
Return

Skrommel

Candle

  • Participant
  • Joined in 2006
  • *
  • Posts: 18
Re: Little help with this code
« Reply #2 on: December 25, 2006, 12:22 AM »
Thank you for the help.
Can you tell why it is not showing up in the editbox?

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: Little help with this code
« Reply #3 on: December 25, 2006, 09:00 AM »
:) Try removing the "s in the Loop line:

Code
Loop, %OutputVar%\*.mp3, 0, 1

Skrommel

Original address: https://www.donationcoder.com/forum/index.php?topic=6702.0