yclee99 Posted May 14, 2009 Share Posted May 14, 2009 (edited) I'm trying something... create an input to get number of combo required $RSVpc = GUICtrlCreateInput("1", 500, 45, 60, 20) ;Number of VIEW PC autoIT will base on user input then create number of combo required. $x3 = 45 For $FLoop3 = 1 To GUICtrlRead($RSVpc) $x3 = $x3 + 25 ;for combo location purpose GUICtrlCreateInput("VIEW0804", 500, $x3, 60, 20) Next But seem like my script doesn't get the update input from user. Currently the number of combo that created is based on $RSVpc default value which is 1. Anyone can give me some ideal how to create a script that number of combo creates will base on user input Edited May 14, 2009 by yclee99 Link to comment Share on other sites More sharing options...
rajeshontheweb Posted May 14, 2009 Share Posted May 14, 2009 #include <GUIConstantsEx.au3> GUICreate("Dynamic CtrlCount", 250, 500) $InputCount = GUICtrlCreateInput("", 15, 15, 50, 20) $btnUpdate = GUICtrlCreateButton("Create", 115, 15, 50, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $btnUpdate _CreateButtons() EndSwitch WEnd Func _CreateButtons() $CtrlCount = Int(GUICtrlRead($InputCount)) If $CtrlCount > 0 Then $top = 50 For $i = 0 To $CtrlCount GUICtrlCreateButton("Button " & $i, 15, $top, 75, 20) $top += 25 Next GUICtrlSetState($btnUpdate,$GUI_DISABLE) EndIf EndFunc ;==>_CreateButtons Try this , it will create controls for you. Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Triblade Posted May 14, 2009 Share Posted May 14, 2009 This quick and dirty code does what you typed and it works.. So is this not what you'd like? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $gui = GUICreate("1", 500, 700) $RSVpc = GUICtrlCreateInput("1", 10, 10, 60, 20) ;Number of VIEW PC $btn = GUICtrlCreateButton("go", 10, 40, 100, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $btn Then create() WEnd Exit Func create() $x3 = 85 For $FLoop3 = 1 To GUICtrlRead($RSVpc) $x3 = $x3 + 25 ;for combo location purpose GUICtrlCreateInput("VIEW0804", 10, $x3, 60, 20) Next EndFunc My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
yclee99 Posted May 14, 2009 Author Share Posted May 14, 2009 #include <GUIConstantsEx.au3> GUICreate("Dynamic CtrlCount", 250, 500) $InputCount = GUICtrlCreateInput("", 15, 15, 50, 20) $btnUpdate = GUICtrlCreateButton("Create", 115, 15, 50, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $btnUpdate _CreateButtons() EndSwitch WEnd Func _CreateButtons() $CtrlCount = Int(GUICtrlRead($InputCount)) If $CtrlCount > 0 Then $top = 50 For $i = 0 To $CtrlCount GUICtrlCreateButton("Button " & $i, 15, $top, 75, 20) $top += 25 Next GUICtrlSetState($btnUpdate,$GUI_DISABLE) EndIf EndFunc ;==>_CreateButtons Thanks a lot guys. This is the 'function' that I want. I will try to applied in my main script. Link to comment Share on other sites More sharing options...
yclee99 Posted May 14, 2009 Author Share Posted May 14, 2009 Does the input box accept 'ENTER' button? Update automatically once ENTER is pressed Link to comment Share on other sites More sharing options...
Triblade Posted May 14, 2009 Share Posted May 14, 2009 No, only if the button is highlighted or selected whatever to call it. Both scripts say that the button has to be pressed accourding to this code: Case $btnUpdate _CreateButtons()oÝ÷ Ø Ýjëh×6If $msg = $btn Then create()oÝ÷ Ù.r¥uú+{¦¦W¬zÖ¡¢ÙÊØZ·^§®Ö¢G²ÊkzËvØ^~éܶ*'~*Þ°LZ^¶Ê¢é]¥«-y·¢·å¡Wµ ê^اìr¸©·*.j·®²)àjëh×6HotKeySet(Chr(13), "_CreateButtons")oÝ÷ ØêÚºÚ"µÍÝÙ^TÙ] ÚLÊK ][ÝØÜX]I][ÝÊ Note: Chr(13) is the equivelant of the enter-key My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
Triblade Posted May 14, 2009 Share Posted May 14, 2009 Note: You should copy this in the fired funtion to disable the hotkey: HotKeySet(Chr(13)) Also note: Both script don't delete the existing controle, so dont run the funtion twice per script-run. (Ok, the first script does disable the run-function button, and I don't ) My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
yclee99 Posted May 14, 2009 Author Share Posted May 14, 2009 Note: You should copy this in the fired funtion to disable the hotkey: HotKeySet(Chr(13)) Also note: Both script don't delete the existing controle, so dont run the funtion twice per script-run. (Ok, the first script does disable the run-function button, and I don't )Thanks dude... After applied the script to my main script, I am facing another 2 issues. I will tried to solve first before seek for help.... p/s:basically your scirpt doesn't have any problem... Link to comment Share on other sites More sharing options...
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