Jump to content

I Need a readonly control with scrollable text in it


Recommended Posts

to put it in a easy way, i need a control just like the below window

first line...











10









20








30









40









50









60









70







80


last line

just like you would be able to scroll down to see the last line of the above code, i need to display a GUI with a readonly or disabled control which will display text with a scrollable readonly display .

i have tried edit / input / label / etc

label works well to resize on various lines of text but that doesnt serve my purpose.

i tried to use the input & edit with multiline / readonly / disabled options but i cant get scroll bars to work when user wont be allowed to edit the control content....

Edited by rajeshontheweb
Link to comment
Share on other sites

I don't know what have you tried but IMO it wasn't hard enough. This is easily done from Koda and it's "basic" stuff.

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

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 258, 214, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Edit1 = GUICtrlCreateEdit("", 8, 16, 241, 185, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetData(-1, "10"&@CRLF&@CRLF&@CRLF&"20"&@CRLF&@CRLF&@CRLF&"30"&@CRLF&@CRLF&@CRLF&"40"&@CRLF&@CRLF&@CRLF&"50"&@CRLF&@CRLF&@CRLF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Sleep(100)
WEnd

Func Form1Close()
    Exit
EndFunc

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

it did work for me initially, and i checked what i missed,

it is actually the WS_AutoScroll. i dont want the whole window to have the scroll box, i need only this editcontrol to have it. anyway of doing it? check it out, in your code, if u just take out the WS_VSCroll, then its lost :-(

Link to comment
Share on other sites

<edit> it does work , probably i need to tell AutoIT that the window needs to support Vertical scroll, only then the Edit control gets a scroll bar assigned :-)

Maybe you put the $WS_VSCROLL in the wrong place but the code enaiman posted doesn't need to be modified to work.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I really don't know what's your problem? How can you say: "probably i need to tell AutoIT that the window needs to support Vertical scroll, only then the Edit control gets a scroll bar assigned :-)"? This doesn't make any sense to me.

The example I gave you works the same with/without $ES_WANTRETURN and the edit control has the vertical scroll bar (horizontal too if you add $WS_HSCROLL)

And - $WS_VSCROLL is not a general setting; not all controls will have a scroll bar

Have a look at this example - if you still continue with your babbles, don't try the code and you don't try to understand it I won't be answering to any of your posts ever. I want to help but when the person I try to help is stubborn, lazy and doesn't make sense I move the hell out of their way.

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

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 258, 244, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Edit1 = GUICtrlCreateEdit("", 8, 16, 241, 95, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$WS_VSCROLL))
GUICtrlSetData(-1, "10"&@CRLF&@CRLF&@CRLF&"20"&@CRLF&@CRLF&@CRLF&"30"&@CRLF&@CRLF&@CRLF&"40"&@CRLF&@CRLF&@CRLF&"50"&@CRLF&@CRLF&@CRLF)
$Edit2 = GUICtrlCreateEdit("", 8, 120, 241, 95, BitOR($ES_AUTOVSCROLL,$ES_READONLY))
GUICtrlSetData(-1, "10"&@CRLF&@CRLF&@CRLF&"20"&@CRLF&@CRLF&@CRLF&"30"&@CRLF&@CRLF&@CRLF&"40"&@CRLF&@CRLF&@CRLF&"50"&@CRLF&@CRLF&@CRLF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Sleep(100)
WEnd

Func Form1Close()
    Exit
EndFunc

Maybe I was harsh but I felt like you need a "wake-up call"

P.S. - for future referrence: try to post some code: either a part of your original code which shows the problem, either some similar code (an example).

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

did sorry a bit harsh but its all in the game. i know how tough it is when the student is stubborn but i wish i am not :-)

probably i havent understood what i have said earlier,

ok here it goes this is what i meant, pls explain what is happening in here.

$Edit1 = GUICtrlCreateEdit("", 8, 16, 241, 185, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN))
GUICtrlSetData(-1, "10"&@CRLF&@CRLF&@CRLF&"20"&@CRLF&@CRLF&@CRLF&"30"&@CRLF&@CRLF&@CRLF&"40"&@CRLF&@CRLF&@CRLF&"50"&@CRLF&@CRLF&@CRLF&"60"&@CRLF&@CRLF&@CRLF)oÝ÷ ÙÚ²{p¢¹ºÚ"µÍÌÍÑY]HHÕRPÝÜX]QY]
    ][ÝÉ][ÝËMKN
K]Ô    ÌÍÑT×ÐUUÕÐÔÓ   ÌÍÑT×ÔPQÓK    ÌÍÑT×ÕÐSUT    ÌÍÕÔ×ÕØÜÛ
JBÕRPÝÙ]]JLK ][ÝÌL ][ÝÉ[ÐÔ[ÐÔ[ÐÔ[É][ÝÌ  ][ÝÉ[ÐÔ[ÐÔ[ÐÔ[É][ÝÌÌ    ][ÝÉ[ÐÔ[ÐÔ[ÐÔ[É][ÝÍ  ][ÝÉ[ÐÔ[ÐÔ[ÐÔ[É][ÝÍL ][ÝÉ[ÐÔ[ÐÔ[ÐÔ[É][ÝÍ  ][ÝÉ[ÐÔ[ÐÔ[ÐÔ

i meant to say that i had checked up the scroll constants for the edit control - ES_* but didnt notice there was something about WS_* which made my code work that is what i wanted to mean. i would be ready to learn anytime. yeah , i am lazy at times but pls dont mistake me i am not stubborn not to learn. i do not mean to hurt or argue, i just wanna learn hope posting this here doesnt go against rules thanks.

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