Jump to content

Scroll Edit to bottom


Recommended Posts

Hey there!

 

So i have made a little program that is supposed to learn from what messages you send, then read on memory and answer depending if the question was found on memory.

Everything works fine except for a little problem

Chat edit input box is not vertically autoscrolling to end of it, i use GUICtrlRead then GUICtrlSetData to read and create a new message on it.

But when messages go off the bounds of box, it scrolls to top instead of scrolling to end.
I would like a way to fix it.

My edit properties are:

$G_Chat = GUICtrlCreateEdit('', 10, 30, 380, 320, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_READONLY, $ES_CENTER))

And i use this to create a new message 

GUICtrlSetData($G_Chat, $ChatLog & @CRLF & '[Centeno] : ' & $ConstantHour & ' - ' & $Date & @CRLF & $Answer)

I just want a way to move the Edit Input scroll bar to end

 

Any help is much appreciated

Link to comment
Share on other sites

This is a very basic example:

#include <EditConstants.au3>
#include <WindowsConstants.au3>

HotKeySet('{ENTER}','SendMsg')

$Main = GUICreate('Example')
$Container = GUICtrlCreateEdit('',10,10,380,300,BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_READONLY, $ES_CENTER))
$MessageBox = GUICtrlCreateEdit('',10,320,380,70)
GUISetState(@SW_SHOW,$Main)

Do
    Sleep(10)
Until GUIGetMsg() = -3

Func SendMsg()
    $Message = GUICtrlRead($MessageBox)
    If $Message Then
        GUICtrlSetData($Container,$Message & @CRLF,1)
        GUICtrlSetData($MessageBox,'')
    EndIf
EndFunc

 

When the words fail... music speaks.

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...