Sign in to follow this  
Followers 0
AhmedV

Disable MenuItem until selecting ListViewItem

6 posts in this topic

Hello, how can i disable the GuiCtrlCreateMenuItem until it selects an item in the ListView

 

Here, how to keep ($lvitem) disabled/un-clickable until it select the (test) or any item in the ListView?

GuiCreate("")
$Listv=guictrlcreatelistview("test|testt|testtt",8,8,50,50,-1)
$menu=Guictrlcreatecontextmenu($listv)
$lvitem=guictrlcreatemenuitem("test", $menu)

Guictrlcreatelistviewitem("item1|bla|bla", $Listv)

Any help would be appreciated. :)

Share this post


Link to post
Share on other sites



You can use GuiCtrlSetState. Make a full runable reproducer script if you need more help.

Share this post


Link to post
Share on other sites
9 minutes ago, AutoBert said:

You can use GuiCtrlSetState. Make a full runable reproducer script if you need more help.

I do using it, but how to Enable the menu item when i try to select an ListViewItem ??

 

Sorry i just can't write the full script now as i post from my phone.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

sample from one of my script (can probably help u) :

While 1

    $Selected = _GUICtrlListView_GetNextItem($ListView)

    If $ListView <> 0 Then
        ;Item Selected
        Msgbox(0,"$Array_ListView[$Selected][0]",$Array_ListView[$Selected][0])
    Else
        ;No Item Selected
    EndIf

WEnd

 

Edited by Synapsee
code edited

Share this post


Link to post
Share on other sites
Just now, Synapsee said:

sample from one of my script (can probably help u) :

While 1

    $Selected = _GUICtrlListView_GetNextItem($ListView) + 1

    If $ListView <> 0 Then
        ;Item Selected
        Msgbox(0,"ListView[$Selected][0]",$ListView[$Selected][0])
    Else
        ;No Item Selected
    EndIf

WEnd

 

Is it ok to use UDF with built-in Commands?

Share this post


Link to post
Share on other sites

i think i understand better. look arroud that maybe (i think its exactly what u want) :

 

 

1 person likes this

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