Jump to content

how to get if user selected item or not


Recommended Posts

how to get if user selected item or not

if user no item selected then will _GUICtrlMenu_SetItemDisabled

if user selected a item then will _GUICtrlMenu_SetItemEnabled

like my function

Func menu($FileView,$hmenu,$Name1)
$p  = _GUICtrlListView_GetItemCount($FileView)
For $i = 0 to $p
$Name = _GUICtrlListView_GetItemSelected(GUICtrlGetHandle($FileView),$i)
If $Name = False Then 
For $i = 1 To $Name1
        _GUICtrlMenu_SetItemDisabled(GUICtrlGetHandle($hmenu), $i)
    Next
EndIf
ExitLoop
If $Name = True Then
    For $i = 1 To $Name1
    _GUICtrlMenu_SetItemEnabled(GUICtrlGetHandle($hmenu), $i)
    Next
EndIf
Next
EndFunc
Edited by name15
Link to comment
Share on other sites

I had to figure this one out on my own here is a sample.

Func D()
    If GUICtrlRead($D) = $GUI_CHECKED Then
        GUICtrlSetState($DateInput, $GUI_ENABLE)
    Else
        GUICtrlSetState($DateInput, $GUI_DISABLE)
    EndIf
EndFunc   ;==>D
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...