Jump to content

[Sloved] Set Resizing for a RichEdit control?


TheDcoder
 Share

Recommended Posts

Hello everyone :), I want to set the resizing of a RichEdit control in a GUI, Unfortunately GUICtrlSetResizing only accepts IDs not Handles :(

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiRichEdit.au3>

$hGUI = GUICreate("Test GUI", 500, 300, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU, $WS_VISIBLE))
$hRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 0, 0, 500, 300)

; GUICtrlSetResizing($hRichEdit, $GUI_DOCKAUTO) ; Don't even think of trying this

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

I want the RichEdit to always fill the whole window, Thanks in Advance :)

 

TD :)

Edited by TheDcoder
Marked As Sloved

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

I figured it out, Thanks to Mat

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiRichEdit.au3>

Global $hGUI = GUICreate("Test GUI", 500, 300, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU, $WS_VISIBLE))
Global $hRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 0, 0, 500, 300)

; GUICtrlSetResizing($hRichEdit, $GUI_DOCKAUTO) ; Don't even think of trying this

GUIRegisterMsg($WM_SIZE, "WM_SIZE") ; Register the function

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
    Local $iWidth = _WinAPI_LoWord($lParam)
    Local $iHeight = _WinAPI_HiWord($lParam)

    _WinAPI_MoveWindow($hRichEdit, 2, 2, $iWidth - 4, $iHeight - 4)

    Return 0
EndFunc   ;==>WM_SIZE, Thanks Mat :)

TD :D

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

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

×
×
  • Create New...