xsharp.eu • How to implement EditFocusChange in Winforms? - Page 2
Page 2 of 2

How to implement EditFocusChange in Winforms?

Posted: Wed Sep 28, 2022 3:08 pm
by wriedmann
Hi Dick,
in .NET every event needs to be registered - and it can also be de-registered.
This concept has the advantage that you can call your callback method how do you like it, you can register more than one callback for every control, and you can register the same callback on different controls.
But, if you have learned the VO lessons, you can also create your own subclass (I have done that for the pushbutton class):

Code: Select all

using System.Windows.Forms
using rdm.BaseLib

class rdmButton inherit Button
constructor()
	super()
	return

protect method OnClick( e as EventArgs ) as void
	super:OnClick( e )
	if self:Parent:IsMethod( self:Name )
		self:Parent:Send( self:Name, null_object )
	endif

	return
end class
Wolfgang