Jump to content
Sign in to follow this  
Rodger

Resize a RichEdit Control

Recommended Posts

Hello,

I am trying to resize a RichEdit Control by using GUICtrlSetResizing($hRichEdit, $GUI_DOCKTOP + $GUI_DOCKBOTTOM) but it doesn't work.

Any ideas?

Rodger

Share this post


Link to post
Share on other sites

I am using the following now:

$msg = GUIGetMsg()

Case $msg = $GUI_EVENT_MAXIMIZE

GUICtrlSetPos ( $hRichEdit, 5, 5, 3000, 750 )

but GUICtrlSetPos does not work. Is there an example script which I can use?

Share this post


Link to post
Share on other sites

Your right !

I found also some code which I could use....

; variables for resizing the RichEditCtrl
$FirstTimeResize = True
$iGUIH = _WinAPI_GetClientHeight ($GUI_PATT)
$iGUIW = _WinAPI_GetClientWidth ($GUI_PATT)

; Resize the RichEditBox and status bar when GUI size changes
Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam)
ConsoleWrite("Resize" & @CRLF)

   Local $iNewH, $iNewW, $iDltH, $iDltW, $iConH, $iConW

   ; Get the new GUI size
    $iNewW = _WinApi_LoWord ($ilParam)
    $iNewH = _WinApi_HiWord ($ilParam)

   ; Get the delta change in the GUI size
    $iDltW = $iNewW - $iGUIW
    $iDltH = $iNewH - $iGUIH

   ; Resize the control
    $iConW = _WinAPI_GetWindowWidth ($PATT_Edit) + $iDltW
    $iConH = _WinAPI_GetWindowHeight ($PATT_Edit) + $iDltH

    ; Because of the StatusBar, we need to correct the Height
    If $iDltH > 0 Then

        If $FirstTimeResize = True Then

            $iConH = $iConH + 20
            $FirstTimeResize = False

        EndIf

    Else

        $iConW = 1220
        $iConH =  665

    EndIf

    _WinAPI_SetWindowPos ($PATT_Edit, 0, 0, 0, $iConW, $iConH, BitOR($SWP_NOMOVE, $SWP_NOZORDER))

   ; Update GUI size variables
    $iGUIW = $iNewW
    $iGUIH = $iNewH

    _GUICtrlStatusBar_Resize ($hStatus)

    Return $GUI_RUNDEFMSG

EndFunc

Thanks !!

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...