Sign in to follow this  
Followers 0
Flisker

Moving Scrool Bar

6 posts in this topic

Hello,

I spend already about 5hours on my problem and can't solve it so I would like to ask anybody for help please.

My problem is that I don't know how to move scrool bar with every new line. I am adding more and more text into gui but when I get over last line I can see it's not moving scrool bar on last line itself(as I would expected).

This is image of script and gui to help understand my problem : Image

Any help would be great :)

p.s. Sorry for my english.

Share this post


Link to post
Share on other sites



Welcome to AutoIt Forum. All you need is $WS_VSCROLL style for your edit control. Hope this will help you:

$MAIN = GUICreate("Example",120,605)
$EDIT = GUICtrlCreateEdit("",5,5,110,595,0x00200000) ; Vertical Scroll: $WS_VSCROLL = 0x00200000
GUISetState(@SW_SHOW,$MAIN)

For $INDEX = 1 To 50
    GUICtrlSetData($EDIT,"Text" & $INDEX & @CRLF,1)
    Sleep(100)
Next

While True
    Switch GUIGetMsg()
        Case -3
            Exit
    EndSwitch
    Sleep(10)
WEnd

When the words fail... music speaks

Share this post


Link to post
Share on other sites

WOW , tyvm for super fast response it's working :)

But now I got another problem -> can't get over 3109 lines , script just stops after this line even if for cycle is set from 1 -> 5000. Is this gui window limited by maximal number of characters it is able to show ?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

According with Microsoft Support

A multiline edit control is also subject to the following limitations:

* The maximum number of characters in a single line is 1024.

* The maximum width of a line is 30,000 pixels.

* The maximum number of lines is approximately 16,350.

EDIT:

But you can use this and will work fine for 5000 lines:

#Include <GuiEdit.au3>

$MAIN = GUICreate("Example",120,605)
$EDIT = _GUICtrlEdit_Create($MAIN,"",5,5,110,595,BitOR(0x0004,0x00200000)) ; Vertical Scroll: $WS_VSCROLL = 0x00200000
GUISetState(@SW_SHOW,$MAIN)

For $INDEX = 1 To 5000
    _GUICtrlEdit_AppendText($EDIT,"Text" & $INDEX & @CRLF)
Next

While True
    Switch GUIGetMsg()
        Case -3
            _GUICtrlEdit_Destroy($EDIT)
            Exit
    EndSwitch
    Sleep(10)
WEnd
Edited by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites

Tbh I dont understand where did u get these functions - _GUICtrlEdit_Create, _GUICtrlEdit_AppendText(I suppouse they are modified versions of GUICtrlCreateEdit and GUICtrlSetData) and how is it possible that now it works but .... it works so again big thank you, this was rly big problem for me :)

Share this post


Link to post
Share on other sites

All there functions are defined in GuiEdit.au3 [see first line in script].


When the words fail... music speaks

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  
Followers 0