I would like to override the TextChanged event of my own inherited textbox. How should I proceed?
For the Click event of an inherited button I do have the following working code, but for a textbox I cannot find the right way.
using System;
using System.Windows.Forms;
using Telerik.WinControls.UI;
namespace Iap.WinUi.Controls.Button
{
public class QButton : RadButton
{
protected override RadButtonElement CreateButtonElement()
{
return new QButtonElement(this);
}
}
public class QButtonElement : RadButtonElement
{
private readonly RadButton Owner;
public QButtonElement(RadButton owner)
{
Owner = owner;
}
protected override void OnClick(EventArgs e)
{
var form = Owner.FindForm();
try
{
// set wait cursor
form.Cursor = Cursors.WaitCursor;
form.Refresh();
// execute base click code
base.OnClick(e);
}
finally
{
// set arrow cursor
form.Cursor = Cursors.Default;
}
}
protected override Type ThemeEffectiveType
{
get { return typeof (RadButtonElement); }
}
}
}
For the Click event of an inherited button I do have the following working code, but for a textbox I cannot find the right way.
using System;
using System.Windows.Forms;
using Telerik.WinControls.UI;
namespace Iap.WinUi.Controls.Button
{
public class QButton : RadButton
{
protected override RadButtonElement CreateButtonElement()
{
return new QButtonElement(this);
}
}
public class QButtonElement : RadButtonElement
{
private readonly RadButton Owner;
public QButtonElement(RadButton owner)
{
Owner = owner;
}
protected override void OnClick(EventArgs e)
{
var form = Owner.FindForm();
try
{
// set wait cursor
form.Cursor = Cursors.WaitCursor;
form.Refresh();
// execute base click code
base.OnClick(e);
}
finally
{
// set arrow cursor
form.Cursor = Cursors.Default;
}
}
protected override Type ThemeEffectiveType
{
get { return typeof (RadButtonElement); }
}
}
}