Guest decibel Posted April 1, 2005 Posted April 1, 2005 What i am doing wrong? i am trying to create GuiCtrlCreateCheckbox and GuiCtrlCreateInput depending of GUICtrlCreateInput variable. but it does not work. any idea? sorry for my english #include <GuiConstants.au3> GuiCreate("Tareas consecutivas", 400, 400) GuiCtrlCreateLabel("Tareas", 30, 15) $input = GUICtrlCreateInput ("1", 70, 15, 40, 20) GuiCtrlCreateUpDown($input) $i = 0 Do $n = 45 + (30 * $i) GuiCtrlCreateCheckbox("", 30, $n, 80, 20) GuiCtrlCreateInput("Sample Input Box", 45, $n, 200, 20) $i = $i + 1 Until $i = $input GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd
GaryFrost Posted April 1, 2005 Posted April 1, 2005 (edited) #include <GuiConstants.au3> Global $input,$updown,$m_win, $i = 0,$ctrlinput[1],$chkbox[1] $m_win = GuiCreate("Tareas consecutivas", 400, 400) GuiCtrlCreateLabel("Tareas", 30, 15) $input = GUICtrlCreateInput ("1", 70, 15, 40, 20) $updown = GuiCtrlCreateUpDown($input) GUICtrlSetLimit($updown,5,0) GuiSetState() for $i = 0 to GUICtrlRead($input) - 1 $n = 45 + (30 * $i) $chkbox[$i] = GuiCtrlCreateCheckbox("", 30, $n, 80, 20) $ctrlinput[$i] = GuiCtrlCreateInput("Sample Input Box", 45, $n, 200, 20) Next Do $msg = GUIGetMsg() Select Case $msg = $updown Or $msg = $input for $i = 0 to UBound($chkbox) - 1 GUICtrlDelete($chkbox[$i]) GUICtrlDelete($ctrlinput[$i]) Next ReDim $chkbox[GUICtrlRead($input)+1] ReDim $ctrlinput[GUICtrlRead($input)+1] for $i = 0 to GUICtrlRead($input) - 1 $n = 45 + (30 * $i) $chkbox[$i] = GuiCtrlCreateCheckbox("", 30, $n, 80, 20) $ctrlinput[$i] = GuiCtrlCreateInput("Sample Input Box", 45, $n, 200, 20) Next EndSelect Until $msg = $GUI_EVENT_CLOSE Edited April 1, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Guest decibel Posted April 1, 2005 Posted April 1, 2005 i'm having new problems, i'm trying to write from a file to $ctrlinput but i cannot make it work. what's wrong? thanks expandcollapse popup#include <GuiConstants.au3> Global $input,$updown,$m_win, $i = 0,$ctrlinput[1],$chkbox[1] $m_win = GuiCreate("Tareas consecutivas", 400, 400) GuiCtrlCreateLabel("Tareas", 30, 15) $input = GUICtrlCreateInput ("1", 70, 15, 40, 20) $updown = GuiCtrlCreateUpDown($input) GUICtrlSetLimit($updown,10,0) $file = FileOpen("test.txt", 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $n = 45 + (30 * $i) $chkbox[$i] = GuiCtrlCreateCheckbox("", 30, $n, 80, 20) $ctrlinput[$i] = GuiCtrlCreateInput($line, 45, $n, 200, 20) $i = $i + 1 $updown = $i Wend FileClose($file) GuiSetState() Do $msg = GUIGetMsg() Select Case $msg = $updown Or $msg = $input for $i = 0 to UBound($chkbox) - 1 GUICtrlDelete($chkbox[$i]) GUICtrlDelete($ctrlinput[$i]) Next ReDim $chkbox[GUICtrlRead($input)+1] ReDim $ctrlinput[GUICtrlRead($input)+1] for $i = 1 to GUICtrlRead($input) $n = 30 + (30 * $i) $chkbox[$i] = GuiCtrlCreateCheckbox("", 30, $n, 80, 20) $ctrlinput[$i] = GuiCtrlCreateInput("Sample Input Box", 45, $n, 200, 20) Next EndSelect Until $msg = $GUI_EVENT_CLOSE
GaryFrost Posted April 1, 2005 Posted April 1, 2005 to begin with $updown is a control id, why are you changing it to the value of $i? you'll have to redim the arrays if there's more than 1 line in the file. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now