Notifications
Clear all

[Closed] mouse wheel

thanks, thanks anf thanks again Kameleon, it’s just what i needed. I`ll implement the solution inmediately. how did you find the solution?

thanks again

I did a search on google and saw that function, then I went to msdn to investigate it further, I’m glad it helps. Cheers

Hi there, I wasnt quite satisfied, so I did a new class that helps handling the scroll by mousewheel, it works so much better! I’ve added it to custom control class project, so you just have to include it as an assembly, here’s the example :

(
	dotnet.loadAssembly @"KClasses.dll" --Dont forget to put the correct path here
	
	local hForm = dotNetObject "MaxCustomControls.MaxForm"
	hForm.Size = dotNetObject "System.Drawing.Size" 290 290
	hForm.FormBorderStyle = (dotnetclass "System.Windows.Forms.FormBorderStyle").FixedToolWindow
	hForm.Text = ""
	hForm.ShowInTaskbar = False
	
	local lstview1 = dotNetObject "System.Windows.Forms.ListView"
	lstview1.backcolor=(dotnetclass "System.Drawing.Color").DarkCyan
	lstview1.location=dotNetObject "System.Drawing.Point" 10 10
	lstview1.name="lstview1"
	
	
	local lstview2 = dotNetObject "System.Windows.Forms.ListView"
	lstview2.location=dotNetObject "System.Drawing.Point" 150 10
	lstview2.name="lstview2"
	
	local lstview3 = dotNetObject "System.Windows.Forms.ListView"
	lstview3.location=dotNetObject "System.Drawing.Point" 10 150
	lstview3.name="lstview3"
	
	local lstview4 = dotNetObject "System.Windows.Forms.ListView"
	lstview4.location=dotNetObject "System.Drawing.Point" 150 150
	lstview4.name="lstview4"
		
	local vScroll=dotnetobject "KClasses.dnVScroll"

	hform.controls.add(lstview1)
	hform.controls.add(lstview2)
	hform.controls.add(lstview3)
	hform.controls.add(lstview4)
	
	
	
	seed(timestamp())
	for i=1 to 20 do
	(
		lstview1.items.add ((random 1 256) as string)
		lstview2.items.add ((random 1 256) as string)
		lstview3.items.add ((random 1 256) as string)
		lstview4.items.add ((random 1 256) as string)
	)
	
	fn lstview1_MouseWheel sender eb =
	(
		eb.handled=true
		vScroll.SetVScroll sender.handle eb
		vScroll.SetVScroll lstview2.handle eb
		vScroll.SetVScroll lstview3.handle eb
		vScroll.SetVScroll lstview4.handle eb
		
	)
	
	dotnet.addEventHandler lstview1 "MouseWheel" lstview1_MouseWheel	
	
	hForm.ShowModeless()
)

And here’s the Dll as an attachment… Cya!

Page 2 / 2