Notifications
Clear all

[Closed] RC Menu Error in ListView

myRC—


RCMenu SS_myMenu
(
menuItem SS_ViewFile "View Image File"

	on SS_myMenu open do
	(
		--(listView3.SelectedItems.Count > 0)
		
		if (myDial.dNet_Files.SelectedItems.count>0) then
		(
			a=myDial.dNet_Files.SelectedItems.Item[0].tag.value
			format "Classof Selected is= %
" (classOf a)
		)
		--print (a as string)
	)


)

when I executed the script on the blank spot of form listView…it return error…


on dNet_Files mouseUp arg do
		(
		if arg.button == (dotnetclass "System.Windows.Forms.MouseButtons").Right then
			(
				if rdo_MissOrFound.state==2 do popUpMenu SS_RelinkMenu pos: [arg.x+dNet_Files.pos.x, arg.y+dNet_Files.pos.y] rollout:SS_myMenu
			
			)
		)


>> MAXScript RCMenu function Exception: -- Runtime error: dotNet runtime exception: InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index <<

can someone point how fix the script ?

Thanks n Best regard

fajar

EDIt : OK Done n resolved…


on dNet_Files mouseUp arg do
		(
		if (arg.button == (dotnetclass "System.Windows.Forms.MouseButtons").Right and myDial.dNet_Files.SelectedItems.count>=1) then
			(
				if rdo_MissOrFound.state==2 do popUpMenu SS_RelinkMenu pos: [arg.x+dNet_Files.pos.x, arg.y+dNet_Files.pos.y] rollout:SS_myMenu
			
			)
		)

1 Reply
 lo1

There is no possible way it is throwing that exception on that line, are you sure it’s not another part?