E1M1 Posted March 13, 2010 Share Posted March 13, 2010 How to auto resize scite? I used UDF to create window with scite, but i cant find way to resize it.link to udf & exampleI have tried GUICtrlSetResizing but it didn't work. edited Link to comment Share on other sites More sharing options...
dani Posted March 13, 2010 Share Posted March 13, 2010 You can resize windows using WinMove. Link to comment Share on other sites More sharing options...
E1M1 Posted March 14, 2010 Author Share Posted March 14, 2010 WinMove resizes window not Scintilla (this is that rich text control that highlights words, it's not a window) sorry for being not cear in my 1st post. edited Link to comment Share on other sites More sharing options...
dani Posted March 14, 2010 Share Posted March 14, 2010 (edited) Ah ok, my bad too I guess. Well I don't know if it behaves like other controls, but regular controls can be resized using a similar function: GUICtrlSetPos.GUICtrlSetResizing only specifies how a control will be resized when the window that contains the control is resized. It does not by itself resize the control. Edited March 14, 2010 by dani Link to comment Share on other sites More sharing options...
E1M1 Posted March 14, 2010 Author Share Posted March 14, 2010 only controlmove() can resize it, but now question: how to call controlmove() every time window size changes? edited Link to comment Share on other sites More sharing options...
dani Posted March 14, 2010 Share Posted March 14, 2010 It's probably something regarding Window Messages or equivalent, unfortunately I have no knowledge on that subject You can try searching the forums, or perhaps someone will read this who does know how that works. Link to comment Share on other sites More sharing options...
Mat Posted March 14, 2010 Share Posted March 14, 2010 (edited) #include <GuiRichEdit.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $hGui, $hRichEdit Main() Func Main() $hGui = GUICreate("Example WM_SIZE", 320, 350, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 330) GUISetState() Local $aPos While 1 Switch GUIGetMsg() Case -3 _GUICtrlRichEdit_Destroy($hRichEdit) Exit Case $GUI_EVENT_RESIZED $aPos = WinGetClientSize($hGui) ControlMove($hGui, "", $hRichEdit, 10, 10, $aPos[0] - 20, $aPos[1] - 20) EndSwitch WEnd EndFunc ;==>Main or with messages: #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Global $hGui, $hRichEdit Main() Func Main() $hGui = GUICreate("Example WM_SIZE", 320, 350, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 330) GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUISetState() While 1 Switch GUIGetMsg() Case -3 _GUICtrlRichEdit_Destroy($hRichEdit) Exit EndSwitch WEnd EndFunc ;==>Main Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Local $aPos = WinGetClientSize($hGui) ControlMove($hGui, "", $hRichEdit, 10, 10, $aPos[0] - 20, $aPos[1] - 20) EndFunc Edited March 14, 2010 by Mat AutoIt Project Listing 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