Jump to content

Can't Hscroll Gui Listand Bitor Question


forger
 Share

Recommended Posts

Hello, I'm a newbie in AutoIT, I started gui'ing tonight quite frankly. :mellow:

Dim $regnum, $regvalue, $regtempvalue, $regtemptext
$regnum = 1
While RegEnumVal("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run",$regnum)
    $regtempvalue = RegEnumVal("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run",$regnum)
    $regtemptext = RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run",$regtempvalue)
    If $regnum == 1 Then
        $regvalue = $regtempvalue & "=" & $regtemptext
    Else
        $regvalue = $regvalue & "|" & $regtempvalue & "=" & $regtemptext
    EndIf
    $regnum = $regnum + 1
WEnd

#region --- GuiBuilder code Start ---
GuiCreate("Registry check", 480, 490,-1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Label_2 = GuiCtrlCreateLabel("Registry", 20, 30, 290, 20)
$List_5 = GUICtrlCreateList("", 20, 50, 290, 97, BitOR($WS_HSCROLL, $WS_VSCROLL))

GuiSetState()
GUICtrlSetData($List_5,$regvalue)

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder code Start ---

I pasted the important stuff. I have no styles whatsoever in any other control anywhere else on the form.

I need both hscroll and vscroll in the list box :) Is that possible?

And why is BitOR used for styles? :)

Link to comment
Share on other sites

Yes

You need to understand bits 1st

Example from beta help

#include <GUIConstants.au3>
#include <GuiList.au3>

Opt ('MustDeclareVars', 1)

Dim $msg, $listbox, $label

GUICreate("ListBox Set Horizontal Extent", 400, 250, -1, -1)

$listbox = GUICtrlCreateList("", 125, 40, 100, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_DISABLENOSCROLL, $WS_HSCROLL))
_GUICtrlListSetHorizontalExtent ($listbox, 120)
GUICtrlSetData($listbox, "test1|more testing|even more testing|demo|test2|test3|test4|test5|test6|test7|test8|")
$label = GUICtrlCreateLabel("HorizontalExtent: " & _GUICtrlListGetHorizontalExtent ($listbox), 150, 210, 120)

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • Moderators

The "stable" version (released version) is not as "stable" as the beta, I would suggest just getting that anyway.

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

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