Jump to content

$ES_AUTOHSCROLL + $ES_AUTOVSCROLL


Mat
 Share

Recommended Posts

  • Moderators

When I use these styles, it does scroll down, but shows no scroll bar.

Is there a way to show the bar, or not?

Thanks

MDiesel

Try using $WS_HSCROLL and $WS_VSCROLL

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

nah...

Smoke_N got the same as I got, it was a very stupid question.

but just out of interest, how would I make line numbers for something like that? I could use a label or another edit that has readonly attrib....but how do I sync them?

This?

http://www.autoitscript.com/forum/index.ph...hl=line+numbers

Edited by mdiesel
Link to comment
Share on other sites

I would create the line numbers this way:

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




   Local $myedit, $msg

    GUICreate("My GUI edit")  ; will create a dialog box that when displayed is centered
    
    $Lines = GUICtrlCreateEdit(StringReplace("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21",",",@CRLF), 10, 10, 30, 300,$ES_READONLY)
    GUICtrlSetState(-1,$GUI_DISABLE)
    $myedit = GUICtrlCreateEdit("First line" & @CRLF, 40, 10, 300, 300)
    GUIRegisterMsg($WM_COMMAND,"MY_WM_COMMAND")

    GUISetState()

    Send("{END}")

    ; will be append dont' forget 3rd parameter
    GUICtrlSetData($myedit, "Second line", 1)

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
    
    Func MY_WM_COMMAND($hWnd, $uMsg, $wParam, $lParam)
        Local $nID = BitAND($wParam,0xFFFF)
        Local $nNotification = BitShift($wParam,16)
        If $nNotification = $EN_VSCROLL And $nID = $myedit Then
            Local $Zahlen
            For $i = 1 To _GUICtrlEdit_GetLineCount($lParam)-1
                $Zahlen &= $i & @CRLF
            Next
            GUICtrlSetData($Lines,$Zahlen)
            _GUICtrlEdit_LineScroll($Lines, 0, _GUICtrlEdit_GetFirstVisibleLine($lParam))
        EndIf
        Return $GUI_RUNDEFMSG
    EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

LOL Brett, thats the exact one i found and posted...The only problem with that is its bi-directional, thats a functionality I don't need, it only needs 1 scroll bar.

@Progandy

thats exactly what I'm looking for, and its small too, unlike some of the ones i've been looking at!

the register message thing...I've not used that before, but it includes other stuff I need too, so thanks again.

Thanks 2 all, sorry for the stupid first question, wasn't thinking straight.

MDiesel

edit: changed code to this:

CODE
#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#include <EditConstants.au3>

#include <GUIEdit.au3>

#include <StaticConstants.au3>

Local $myedit, $msg

GUICreate("My GUI edit", -1, -1, 100, 100, $WS_SIZEBOX) ; will create a dialog box that when displayed is centered

$Lines = GUICtrlCreateEdit(StringReplace("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21",",",@CRLF), 10, 10, 30, 300,$ES_READONLY)

GUICtrlSetState(-1,$GUI_DISABLE)

GUICtrlSetResizing ($Lines, $GUI_DOCKWIDTH + $GUI_DOCKLEFT)

$myedit = GUICtrlCreateEdit("First line" & @CRLF, 40, 10, 300, 300)

GUICtrlSetResizing ($myedit, $GUI_DOCKLEFT + $GUI_DOCKRIGHT)

GUIRegisterMsg($WM_COMMAND,"MY_WM_COMMAND")

GUISetState()

Send("{END}")

; will be append dont' forget 3rd parameter

GUICtrlSetData($myedit, "Second line", 1)

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

WEnd

GUIDelete()

Func MY_WM_COMMAND($hWnd, $uMsg, $wParam, $lParam)

Local $nID = BitAND($wParam,0xFFFF)

Local $nNotification = BitShift($wParam,16)

If $nNotification = $EN_VSCROLL And $nID = $myedit Then

Local $Zahlen

For $i = 1 To _GUICtrlEdit_GetLineCount($lParam)-1

$Zahlen &= $i & @CRLF

Next

GUICtrlSetData($Lines,$Zahlen)

_GUICtrlEdit_LineScroll($Lines, 0, _GUICtrlEdit_GetFirstVisibleLine($lParam))

EndIf

Return $GUI_RUNDEFMSG

EndFunc

 

Edited by Melba23
Added code tags
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...