event handler for a custom thumbnails

Hi,

I need help with a dot-net. My frirnd and I are making a custom library image browser using dot-net in max rollout. The thumbnails are showing properly using/loading custom dot-net controls. But we cannot managed to set an event handler when clicking a thumb. we want something like
"on small_dialog clicked sender arg do ()". But the click makes no change

do we need to make an new event and make it public from dot-net? I attached the code and dll as well and a screenshot.

I know partial max-script and he knows moderate dot-net. together we are almost disastrous.

AttachmentSize
small_browser_help_post.png402.53 KB
image_preview.ms1.77 KB
image_preview_dll.zip172.3 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
SimonBourgeois's picture

Hi,

Here are some example for dotnet button click event.
For a classic maxscript rollout:

(
	rollout testRollout "Test Rollout" width:300 height:300
	(
		dotNetControl testBtn "System.Windows.Forms.Button" pos:[75,75] width:150 height:150
 
		on testRollout open do
		(
			testBtn.text = "Click Me"
		)
		on testBtn click do --use click instead of pressed ;)
		(
			print "button clicked"
		)
	)
createDialog testRollout
)

For a dotnet windows:

(
	fn onButtonPressed Sender arg =
	(
		print "button clicked"
	)
	testBtn = dotNetObject "System.Windows.Forms.Button"
	testBtn.text = "Click Me"
	testBtn.size = dotNetObject "System.Drawing.Size" 150 150
	testBtn.location = dotNetObject "System.Drawing.Point" 75 75
	testForm = dotNetObject "System.Windows.Forms.Form"
	testForm.size = dotNetObject "System.Drawing.Size" 300 300
	testForm.controls.add testBtn
	testForm.topmost = true
	dotNet.addEventHandler testBtn "click" onButtonPressed
	testForm.show()
)
zahid hasan's picture

Thank you a lot.

Thank you a lot.

SimonBourgeois's picture

you're welcome

:)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.