ContextMenu Question

Get help with using AutoHotkey and its commands and hotkeys
afe
Posts: 574
Joined: 06 Dec 2018, 04:36

ContextMenu Question

25 Jan 2019, 04:43

Hello,
If the value of column 1 of the ListView is 0, right-click on the row and select Copy to get the value of column 2 of the row.

But A_EventInfo in the Copy tab seems to have a problem, how to modify it?

Thanks.

Code: Select all

Gui, Add, Tab3,, TAB
Gui, Add, ListView, r5 w400 vListView, Column1|Column2
Menu, ContextMenu, Add, Copy, Copy
LV_Add(, 0, 1)
Gui, Tab
Gui, Show
return

GuiContextMenu:
if ( A_GuiControl = "ListView" )
{
	if ( A_GuiEvent = "RightClick" )
	{
		F := LV_GetNext(, Focused)
		if ( F != 0 )
		{
			LV_GetText(Column1Value, A_EventInfo, 1)
			if ( Column1Value = 0 )
				Menu, ContextMenu, Show
		}
	}
}
return

Copy:
LV_GetText(Column2Value, A_EventInfo, 2)
msgbox % Column2Value
return

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Bpd, Chunjee, DRocks, Google [Bot], KilliK, lostahkr, SuperFoobar and 66 guests