jcpetu Posted October 25, 2020 Share Posted October 25, 2020 Hi people, I'm trying to resize a Richedit without success, can anyone help please. expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> ;---------------------------------------------------------------------------------------------------------------------- #Region Options Opt('GUIOnEventMode', 1) Opt('GUICloseOnESC', 0) #EndRegion Options #Region Variables Global $GuiMain, $GUIversion = 'Rich Edit Resize', $DeskW = @DesktopWidth - 13, $DeskH = @DesktopHeight - 60 Global $I1, $I2, $Edit1, $Edit2 #EndRegion Variables $GuiMain = GUICreate($GUIversion, $DeskW, $DeskH, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, 'CloseApp') $I1 = GUICtrlCreateInput('', 66, 30, 581, 31) GUICtrlSetResizing(-1, 1) $I2 = GUICtrlCreateInput('', 66, 70, 581, 31) GUICtrlSetResizing(-1, 1) $Edit1 = _GUICtrlRichEdit_Create($GuiMain, '', 10, 140, ($DeskW / 2) - 10, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) GUICtrlSetResizing(-1, 1) $Edit2 = _GUICtrlRichEdit_Create($GuiMain, '', ($DeskW / 2) + 10, 140, ($DeskW / 2) - 15, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) GUICtrlSetResizing(-1, 1) $LV1 = GUICtrlCreateListView("", 8, 480, $DeskW - 18, 161, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUICtrlSetResizing(-1, 1) _GUICtrlListView_AddColumn(-1, "#", 30, 1) _GUICtrlListView_AddColumn(-1, "Date", 110, 2) _GUICtrlListView_AddColumn(-1, "Time", 110, 2) _GUICtrlListView_AddColumn(-1, "Event", 110, 2) GUISetState(@SW_SHOW, $GuiMain) While 1 WEnd Func CloseApp() _GUICtrlRichEdit_Destroy($Edit1) _GUICtrlRichEdit_Destroy($Edit2) GUIDelete($GuiMain) Exit EndFunc ;==>CloseApp Thanks! Link to comment Share on other sites More sharing options...
Musashi Posted October 25, 2020 Share Posted October 25, 2020 Take a look at : TheDcoder 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 25, 2020 Moderators Share Posted October 25, 2020 (edited) jcpetu, GUIctrlSetResizing only works for native controls - when i need to resize a UDF-created control I usually use a disabled label like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> ;---------------------------------------------------------------------------------------------------------------------- #Region Options Opt('GUIOnEventMode', 1) Opt('GUICloseOnESC', 0) #EndRegion Options #Region Variables Global $GuiMain, $GUIversion = 'Rich Edit Resize', $DeskW = @DesktopWidth - 13, $DeskH = @DesktopHeight - 60 Global $I1, $I2, $Edit1, $Edit2 #EndRegion Variables $GuiMain = GUICreate($GUIversion, $DeskW, $DeskH, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, 'CloseApp') GUISetBkColor(0xC4C4C4) ; Just so you can see the RichEdits $I1 = GUICtrlCreateInput('', 66, 30, 581, 31) GUICtrlSetResizing(-1, 1) $I2 = GUICtrlCreateInput('', 66, 70, 581, 31) GUICtrlSetResizing(-1, 1) $Edit1 = _GUICtrlRichEdit_Create($GuiMain, '', 10, 140, ($DeskW / 2) - 10, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) ; Create underlying label $cLabel_1 = GUICtrlCreateLabel("", 10, 140, ($DeskW / 2) - 10, 320) GUICtrlSetResizing($cLabel_1, 1) GUICtrlSetState($cLabel_1, $GUI_DISABLE) ; Most important! $Edit2 = _GUICtrlRichEdit_Create($GuiMain, '', ($DeskW / 2) + 10, 140, ($DeskW / 2) - 15, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) $cLabel_2 = GUICtrlCreateLabel("", ($DeskW / 2) + 10, 140, ($DeskW / 2) - 15, 320) GUICtrlSetResizing($cLabel_2, 1) GUICtrlSetState($cLabel_2, $GUI_DISABLE) $LV1 = GUICtrlCreateListView("", 8, 480, $DeskW - 18, 161, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUICtrlSetResizing(-1, 1) _GUICtrlListView_AddColumn(-1, "#", 30, 1) _GUICtrlListView_AddColumn(-1, "Date", 110, 2) _GUICtrlListView_AddColumn(-1, "Time", 110, 2) _GUICtrlListView_AddColumn(-1, "Event", 110, 2) GUISetState(@SW_SHOW, $GuiMain) ; Register the SIZE message GUIRegisterMsg($WM_SIZE, "_WM_SIZE") While 1 Sleep(10) WEnd Func CloseApp() _GUICtrlRichEdit_Destroy($Edit1) _GUICtrlRichEdit_Destroy($Edit2) GUIDelete($GuiMain) Exit EndFunc ;==>CloseApp Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; If it is our GUI If $hWnd = $GuiMain Then ; Get the new position and size of the labels $aPos_1 = ControlGetPos($GuiMain, "", $cLabel_1) $aPos_2 = ControlGetPos($GuiMain, "", $cLabel_2) ; And set the RichEdits to the same position and size WinMove($Edit1, "", $aPos_1[0], $aPos_1[1], $aPos_1[2], $aPos_1[3]) WinMove($Edit2, "", $aPos_2[0], $aPos_2[1], $aPos_2[2], $aPos_2[3]) EndIf EndFunc M23 Edit: Same principle as the post above. Edited October 25, 2020 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jcpetu Posted October 25, 2020 Author Share Posted October 25, 2020 Musashi, the workaround of TheDcoder works fine only if there is a Richedit that occupies all the window area. Melba, I modified your script just commenting the GUISetBkColor and positioning each label before the Richedit. But when I resize the GUI the Richedit controls doesn't resize correctly. 😕 expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> ;---------------------------------------------------------------------------------------------------------------------- #Region Options Opt('GUIOnEventMode', 1) Opt('GUICloseOnESC', 0) #EndRegion Options #Region Variables Global $GuiMain, $GUIversion = 'Rich Edit Resize', $DeskW = @DesktopWidth - 13, $DeskH = @DesktopHeight - 60 Global $I1, $I2, $Edit1, $Edit2 #EndRegion Variables $GuiMain = GUICreate($GUIversion, $DeskW, $DeskH, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, 'CloseApp') ;GUISetBkColor(0xC4C4C4) ; Just so you can see the RichEdits $I1 = GUICtrlCreateInput('', 66, 30, 581, 31) GUICtrlSetResizing(-1, 1) $I2 = GUICtrlCreateInput('', 66, 70, 581, 31) GUICtrlSetResizing(-1, 1) $cLabel_1 = GUICtrlCreateLabel("", 10, 140, ($DeskW / 2) - 10, 320) GUICtrlSetResizing($cLabel_1, 1) GUICtrlSetState($cLabel_1, $GUI_DISABLE) ; Most important! $Edit1 = _GUICtrlRichEdit_Create($GuiMain, '', 10, 140, ($DeskW / 2) - 10, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) ; Create underlying label $cLabel_2 = GUICtrlCreateLabel("", ($DeskW / 2) + 10, 140, ($DeskW / 2) - 15, 320) GUICtrlSetResizing($cLabel_2, 1) GUICtrlSetState($cLabel_2, $GUI_DISABLE) $Edit2 = _GUICtrlRichEdit_Create($GuiMain, '', ($DeskW / 2) + 10, 140, ($DeskW / 2) - 15, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) $LV1 = GUICtrlCreateListView("", 8, 480, $DeskW - 18, 161, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUICtrlSetResizing(-1, 1) _GUICtrlListView_AddColumn(-1, "#", 30, 1) _GUICtrlListView_AddColumn(-1, "Date", 110, 2) _GUICtrlListView_AddColumn(-1, "Time", 110, 2) _GUICtrlListView_AddColumn(-1, "Event", 110, 2) GUISetState(@SW_SHOW, $GuiMain) ; Register the SIZE message GUIRegisterMsg($WM_SIZE, "_WM_SIZE") While 1 Sleep(10) WEnd Func CloseApp() _GUICtrlRichEdit_Destroy($Edit1) _GUICtrlRichEdit_Destroy($Edit2) GUIDelete($GuiMain) Exit EndFunc ;==>CloseApp Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; If it is our GUI If $hWnd = $GuiMain Then ; Get the new position and size of the labels $aPos_1 = ControlGetPos($GuiMain, "", $cLabel_1) $aPos_2 = ControlGetPos($GuiMain, "", $cLabel_2) ; And set the RichEdits to the same position and size WinMove($Edit1, "", $aPos_1[0], $aPos_1[1], $aPos_1[2], $aPos_1[3]) WinMove($Edit2, "", $aPos_2[0], $aPos_2[1], $aPos_2[2], $aPos_2[3]) EndIf EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 26, 2020 Moderators Share Posted October 26, 2020 jcpetu, The script works if you resize the GUI by dragging the mouse - I suspect in the case above you are using the minimize/maximize buttons of the GUI. In that case we need to widen the events that trigger the resizing - like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> ;---------------------------------------------------------------------------------------------------------------------- #Region Options Opt('GUIOnEventMode', 1) Opt('GUICloseOnESC', 0) #EndRegion Options #Region Variables Global $GuiMain, $GUIversion = 'Rich Edit Resize', $DeskW = @DesktopWidth - 13, $DeskH = @DesktopHeight - 60 Global $I1, $I2, $Edit1, $Edit2 #EndRegion Variables $GuiMain = GUICreate($GUIversion, $DeskW, $DeskH, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, 'CloseApp') GUISetOnEvent($GUI_EVENT_RESTORE, '_Resize') GUISetOnEvent($GUI_EVENT_MAXIMIZE, '_Resize') ;GUISetBkColor(0xC4C4C4) ; Just so you can see the RichEdits $I1 = GUICtrlCreateInput('', 66, 30, 581, 31) GUICtrlSetResizing(-1, 1) $I2 = GUICtrlCreateInput('', 66, 70, 581, 31) GUICtrlSetResizing(-1, 1) $cLabel_1 = GUICtrlCreateLabel("", 10, 140, ($DeskW / 2) - 10, 320) GUICtrlSetResizing($cLabel_1, 1) GUICtrlSetState($cLabel_1, $GUI_DISABLE) ; Most important! $Edit1 = _GUICtrlRichEdit_Create($GuiMain, '', 10, 140, ($DeskW / 2) - 10, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) ; Create underlying label $cLabel_2 = GUICtrlCreateLabel("", ($DeskW / 2) + 10, 140, ($DeskW / 2) - 15, 320) GUICtrlSetResizing($cLabel_2, 1) GUICtrlSetState($cLabel_2, $GUI_DISABLE) $Edit2 = _GUICtrlRichEdit_Create($GuiMain, '', ($DeskW / 2) + 10, 140, ($DeskW / 2) - 15, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) $LV1 = GUICtrlCreateListView("", 8, 480, $DeskW - 18, 161, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUICtrlSetResizing(-1, 1) _GUICtrlListView_AddColumn(-1, "#", 30, 1) _GUICtrlListView_AddColumn(-1, "Date", 110, 2) _GUICtrlListView_AddColumn(-1, "Time", 110, 2) _GUICtrlListView_AddColumn(-1, "Event", 110, 2) GUISetState(@SW_SHOW, $GuiMain) ; Register the SIZE message GUIRegisterMsg($WM_SIZE, "_WM_SIZE") While 1 Sleep(10) WEnd Func CloseApp() _GUICtrlRichEdit_Destroy($Edit1) _GUICtrlRichEdit_Destroy($Edit2) GUIDelete($GuiMain) Exit EndFunc ;==>CloseApp Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; If it is our GUI If $hWnd = $GuiMain Then _Resize() EndIf EndFunc Func _Resize() ; Get the new position and size of the labels $aPos_1 = ControlGetPos($GuiMain, "", $cLabel_1) $aPos_2 = ControlGetPos($GuiMain, "", $cLabel_2) ; And set the RichEdits to the same position and size WinMove($Edit1, "", $aPos_1[0], $aPos_1[1], $aPos_1[2], $aPos_1[3]) WinMove($Edit2, "", $aPos_2[0], $aPos_2[1], $aPos_2[2], $aPos_2[3]) EndFunc How is it now? M23 Musashi and pixelsearch 2 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jcpetu Posted October 26, 2020 Author Share Posted October 26, 2020 Melba23, in my case when I minimize/maximize it works fine but when I drag the mouse occurs something strange, the first time I drag the mouse it doesn't resize the Richedits correctly, if I drag the mouse again in the same direction as I did before but only few pixels, it resize the Richedits correctly, but if I drag the mouse in other direction or a longer distance it doesn't resize them well.😳 I also noticed that if the Richedits are not correctly resized and I open another program and the go to my GUI, the Richedits auto resize well. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 26, 2020 Moderators Share Posted October 26, 2020 jcpetu, Very strange - everything works just fine for me. As the RichEdits do resize correctly when you do something else, try adding this line at the end of the _Resize function: _WinAPI_RedrawWindow($GuiMain) Any better? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jcpetu Posted October 26, 2020 Author Share Posted October 26, 2020 No, for some reason it doesn't work. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 26, 2020 Moderators Share Posted October 26, 2020 jcpetu, Then I am afraid I am out of ideas. Using the script I have not yet managed to fail to get the RichEdits resized when the GUI is resized - and I have been using this trick for many years to resize UDF-created controls without problem. Sorry. M23 jcpetu 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jcpetu Posted October 26, 2020 Author Share Posted October 26, 2020 Melba23, no problem, thanks a lot for your time. Link to comment Share on other sites More sharing options...
Nine Posted October 26, 2020 Share Posted October 26, 2020 Tested M23 code, and it is also working perfectly fine both Win7 and Win10. I'm afraid there is something different in your setup. “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
jcpetu Posted October 26, 2020 Author Share Posted October 26, 2020 The only thing could be that I have two monitors? Link to comment Share on other sites More sharing options...
jcpetu Posted October 26, 2020 Author Share Posted October 26, 2020 I've got Win 8.11. Link to comment Share on other sites More sharing options...
Nine Posted October 26, 2020 Share Posted October 26, 2020 1 minute ago, jcpetu said: The only thing could be that I have two monitors? Could be IDK. You could try to remove one monitor temporarily, see if that changes anything... “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
jcpetu Posted October 26, 2020 Author Share Posted October 26, 2020 OK, I will. Link to comment Share on other sites More sharing options...
jcpetu Posted October 26, 2020 Author Share Posted October 26, 2020 No, same with only one monitor. 😕 Link to comment Share on other sites More sharing options...
caramen Posted October 28, 2020 Share Posted October 28, 2020 (edited) I had strange problem too recently solved with a GUI redraw. _WinAPI_RedrawWindow($hGui) @Nine Edited October 28, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
jcpetu Posted October 29, 2020 Author Share Posted October 29, 2020 Hi caramen, I also use _WinAPI_RedrawWindow right after WinMove but the resize issue persists. Thanks anyway for the advise. Link to comment Share on other sites More sharing options...
jcpetu Posted October 29, 2020 Author Share Posted October 29, 2020 I just use _WinAPI_RedrawWindow($GuiMain) wich is the GUI where the RichEdits are included. Am I right? Link to comment Share on other sites More sharing options...
pixelsearch Posted December 18, 2020 Share Posted December 18, 2020 Hi everybody, I would like to revive this thread for 2 reasons : 1) In case jcpetu (OP) still got his issue unsolved, maybe the solution below could work for him. 2) To share with you an alternate way of resizing UDF-created controls, without using the "disabled label way" described in this thread (though it worked fine for me). All credits go to MrCreatoR's UDF GUICtrlSetResizingEx.au3 version 1.3 found in this link. For the record, I discovered MrCreatoR's UDF just now, after having read this new thread from matwachich in this link. So here is jcpetu's code, simplified, with 1 line only to resize the RichEdit controls and it worked great for me, with lesser (apparent) code. Fingers crossed for you, jcpetu expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> #include 'GUICtrlSetResizingEx.au3' ; https://www.autoitscript.com/forum/topic/202781-guictrlsetresizing-on-udf-createwindowex-created-controls/?tab=comments#comment-1455745 Opt('GUIOnEventMode', 1) Opt('GUICloseOnESC', 0) Global $GuiMain, $GUIversion = 'Rich Edit Resize', $DeskW = @DesktopWidth - 20, $DeskH = @DesktopHeight - 80 Global $I1, $I2, $Edit1, $Edit2 $GuiMain = GUICreate($GUIversion, $DeskW, $DeskH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) ; GUISetBkColor(0xC4C4C4) ; Just so you can see the RichEdits GUISetOnEvent($GUI_EVENT_CLOSE, 'CloseApp') $I1 = GUICtrlCreateInput('', 66, 30, 581, 31) GUICtrlSetResizing(-1, 1) $I2 = GUICtrlCreateInput('', 66, 70, 581, 31) GUICtrlSetResizing(-1, 1) $Edit1 = _GUICtrlRichEdit_Create($GuiMain, '', 10, 140, ($DeskW / 2) - 10, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) _GUICtrlSetResizingEx($Edit1, $GUI_DOCKAUTO) $Edit2 = _GUICtrlRichEdit_Create($GuiMain, '', ($DeskW / 2) + 10, 140, ($DeskW / 2) - 15, 320, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL)) _GUICtrlSetResizingEx($Edit2, $GUI_DOCKAUTO) $LV1 = GUICtrlCreateListView("", 8, 480, $DeskW - 18, 161, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUICtrlSetResizing(-1, 1) _GUICtrlListView_AddColumn(-1, "#", 30, 1) _GUICtrlListView_AddColumn(-1, "Date", 110, 2) _GUICtrlListView_AddColumn(-1, "Time", 110, 2) _GUICtrlListView_AddColumn(-1, "Event", 110, 2) GUISetState(@SW_SHOW, $GuiMain) While 1 Sleep(10) WEnd Func CloseApp() _GUICtrlRichEdit_Destroy($Edit1) _GUICtrlRichEdit_Destroy($Edit2) GUIDelete($GuiMain) Exit EndFunc ;==>CloseApp To make it easier for you to run the script, I attach below MrCreatoR's UDF GUICtrlSetResizingEx.au3 (version 1.3 dated 09/22/2015), it's the original UDF as found in his archive file : GUICtrlSetResizingEx.au3 ioa747, FrancescoDiMuro and jcpetu 2 1 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