Jump to content

GUICtrlSetResizing for _GUICtrlRichEdit does not work?


 Share

Recommended Posts

Hi everybody,

I do use a _GUICtrlRichEdit-Control in my script. The GUI is resizeable and the RichEdit-control should always fill out the GUI-clientsize. I tried it by using

GUICtrlSetResizing($hRichEdit, $GUI_DOCKAUTO)
but that doesn't seem to work.

See this example code from the helpfile expanded by an editfield which resizes correctly. Why isn't the RichEdit-control behave like the edit-field?

#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Main()

Func Main()
    Local $hGui, $hRichEdit, $iMsg
    $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName,4) &")", 320, 350, -1, -1, BitOr($WS_SIZEBOX, $WS_SYSMENU))
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
    GUICtrlSetResizing($hRichEdit, $GUI_DOCKAUTO)
    $Edit = GUICtrlCreateEdit("This is a edit field", 10, 240, 300, 80)
    _GUICtrlRichEdit_AppendText($hRichEdit, @CR & "This is more text")
    GUISetState()

    While True
        $iMsg = GUIGetMsg()
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                GUIDelete()
                Exit
        EndSelect
    WEnd
EndFunc   ;==>Main

At the moment I use the GUI-message-loop checking the GUI-Size and change the richedit-size if required as a workaround. But this is a very dirty workaround because during the resizing process (while dragging a border of the GUI) the richedit control doesn't yet change the size. It will be done after the resizing process is finished.... ugly...

UTA

Link to comment
Share on other sites

The RichEdit is not a native AutoIt-Control, so GUICtrlSetResizing won't work. You have to resize it on your own in a function called on WM_ENTERSIZEMOVE, WM_EXITSIZEMOVE, WM_SIZE or WM_SIZING via GUIREgisterMsg. Alternatively you can use the GUIGetMsg-Event $GUI_EVENT_RESIZED

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...