Sign in to follow this  
Followers 0
taietel

Vertical Menu

1 post in this topic

#1 ·  Posted (edited)

I've tried to put a vertical menu in a form, using an ActiveX control (see attachment), but I fail big time...  :mellow:. It creates the object, but it blinks continuously when I move the mouse and second menu is not showing.

I have no problem in VB6, but... I need your guidance in this issue...

Here is a code sample:

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

$Form1 = GUICreate("Form1", 600, 400)
$Obj1 = ObjCreate("MeniuVert.MeniuVertical")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 10, 10, 130, 380)
If IsObj($Obj1) Then
    ConsoleWrite("Object created succesfully!" & @CRLF)
        With $Obj1
            .MenusMax = 2                        ;max number of vertical menus

            .MenuCur = 1                        ;select first menu
            .MenuCaption = "Meniu 1"            ;set caption
            .MenuItemsMax = 3                    ;set number of items in the first menu
            .MenuItemCur = 1                    ;select first submenu of the first menu
            .MenuItemCaption = "Submeniu 11"    ;set caption for that
            .MenuItemCur = 2                    ;select second submenu of the first menu
            .MenuItemCaption = "Submeniu 12"    ;set caption for that
            .MenuItemCur = 3                    ;select third submenu of the first menu
            .MenuItemCaption = "Submeniu 13"    ;set caption for that

            .MenuCur = 2
            .MenuCaption = "Meniu 2"
            .MenuItemsMax = 3
            .MenuItemCur = 1
            .MenuItemCaption = "Submeniu 21"
            .MenuItemCur = 2
            .MenuItemCaption = "Submeniu 22"
            .MenuItemCur = 3
            .MenuItemCaption = "Submeniu 23"

            .MenuCur = 1                        ;set default menu at runtime
        EndWith
Else
    ConsoleWrite("Object creation failed!..." & @CRLF)
EndIf

GUISetState()

While 1
    Sleep(100)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

[EDIT] I have a problem with attachment. I've put the files (meniuvert.ocx, a print preview of VB6 sample form and the code above) here .

Edited by taietel

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