Tech63 Posted December 13, 2019 Posted December 13, 2019 I have a re-sizable GUI with GRID like input boxes. Each box will only contain 2-3 insertable characters. There are few features i would like to add, just a newbie and can't figure out it. When i resize the gui, the input boxes width expands to size of the GUI, but the Height remains the same, is there anyway to increase to Height when the gui is resized? Also, would like to add a "reset" button at the bottom to Clear any text that has been typed into all the fields. Any help or pointers would be greatly appreciated. Thank you expandcollapse popup#include <GUIConstants.au3> Example() Func Example() Local $hGUI = GUICreate("DG", 132, 125, -1, -1, $WS_SIZEBOX + $WS_EX_LAYERED) GUISetState(@SW_SHOW, $hGUI) WinSetTrans($hGUI, "", 170) GUICtrlCreateInput("", 0, 0, 33, 25) GUICtrlCreateInput("", 33, 0, 34, 25) GUICtrlCreateInput("", 67, 0, 34, 25) GUICtrlCreateInput("", 100, 0, 34, 25) GUICtrlCreateInput("", 0, 25, 33, 25) GUICtrlCreateInput("", 33, 25, 34, 25) GUICtrlCreateInput("", 67, 25, 34, 25) GUICtrlCreateInput("", 100, 25, 34, 25) GUICtrlCreateInput("", 0, 50, 33, 25) GUICtrlCreateInput("", 33, 50, 34, 25) GUICtrlCreateInput("", 67, 50, 34, 25) GUICtrlCreateInput("", 100, 50, 34, 25) GUICtrlCreateInput("", 0, 75, 33, 25) GUICtrlCreateInput("", 33, 75, 34, 25) GUICtrlCreateInput("", 67, 75, 34, 25) GUICtrlCreateInput("", 100, 75, 34, 25) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example
Nine Posted December 14, 2019 Posted December 14, 2019 Here : #include <GUIConstants.au3> Example() Func Example() Local $hGUI = GUICreate("DG", 132, 150, -1, -1, $WS_SIZEBOX + $WS_EX_LAYERED) WinSetTrans($hGUI, "", 170) Local $aInput[4][4] For $i = 0 to 3 For $j = 0 to 3 $aInput[$i][$j] = GUICtrlCreateInput("", round($j*33.3), $i*25, 33+($j?1:0), 25) GUICtrlSetResizing (-1, $GUI_DOCKAUTO) Next Next Local $idClear = GUICtrlCreateButton ("Clear",50,101,32,25) GUICtrlSetResizing (-1, $GUI_DOCKAUTO) GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idClear For $i = 0 to 3 For $j = 0 to 3 GUICtrlSetData ($aInput[$i][$j],"") Next Next EndSwitch WEnd EndFunc ;==>Example “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
mikell Posted December 15, 2019 Posted December 15, 2019 An alternative way, to use only if explicit names are needed for the inputs expandcollapse popup#include <GUIConstants.au3> Example() Func Example() Local $hGUI = GUICreate("DG", 132, 125, -1, -1, $WS_SIZEBOX + $WS_EX_LAYERED) GUISetState(@SW_SHOW, $hGUI) WinSetTrans($hGUI, "", 170) $input1 = GUICtrlCreateInput("", 0, 0, 33, 25) GUICtrlCreateInput("", 33, 0, 34, 25) GUICtrlCreateInput("", 67, 0, 34, 25) GUICtrlCreateInput("", 100, 0, 34, 25) GUICtrlCreateInput("", 0, 25, 33, 25) GUICtrlCreateInput("", 33, 25, 34, 25) GUICtrlCreateInput("", 67, 25, 34, 25) GUICtrlCreateInput("", 100, 25, 34, 25) GUICtrlCreateInput("", 0, 50, 33, 25) GUICtrlCreateInput("", 33, 50, 34, 25) GUICtrlCreateInput("", 67, 50, 34, 25) GUICtrlCreateInput("", 100, 50, 34, 25) GUICtrlCreateInput("", 0, 75, 33, 25) GUICtrlCreateInput("", 33, 75, 34, 25) GUICtrlCreateInput("", 67, 75, 34, 25) $input16 = GUICtrlCreateInput("", 100, 75, 34, 25) For $i = $input1 To $input16 GUICtrlSetResizing ($i, $GUI_DOCKAUTO) Next While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example
Zedna Posted December 15, 2019 Posted December 15, 2019 Also look at AutoitSetOption/GUIResizeMode https://www.autoitscript.com/autoit3/docs/functions/AutoItSetOption.htm#GUIResizeMode Resources UDF ResourcesEx UDF AutoIt Forum Search
Tech63 Posted December 16, 2019 Author Posted December 16, 2019 Thank you all very much! It's working just as i needed, and learned some new things in the process. Thanks for the example codes I really appreciate it!
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