How to implement EditFocusChange in Winforms?

This forum is meant for questions and discussions about the X# language and tools
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

How to implement EditFocusChange in Winforms?

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply