Thx for your help so far, but........ since I'm a VB programmmer, do you
"Alexander Vasilevsky" wrote:
> Please try code below
>
> using System;
> using System.Windows.Forms;
>
> namespace CmdShell
> {
> class TextBoxIButtonControl : TextBox, IButtonControl
> {
> protected override void OnKeyPress(KeyPressEventArgs e)
> {
> if (e.KeyChar == '\n')
> {
> e.Handled = true;
> PerformClick();
> }
> base.OnKeyPress(e);
> }
>
> #region IButtonControl Members
>
> public DialogResult DialogResult
> {
> get
> {
> throw new Exception("The method or operation is not
> implemented.");
> }
> set
> {
> throw new Exception("The method or operation is not
> implemented.");
> }
> }
>
> public void NotifyDefault(bool value)
> {
> //throw new Exception("The method or operation is not
> implemented.");
> }
>
> public void PerformClick()
> {
> MessageBox.Show("Test");
> //throw new Exception("The method or operation is not
> implemented.");
> }
>
> #endregion
> }
> }
>
>
>
http://www.alvas.net - Audio tools for C# and VB.Net developers
>
>
> "Luc" <Luc@discussions.microsoft.com> ÓÃÃÂÃÉÌ/ÓÃÃÂÃÉÌà × ÃŽÃ×ÃÓÔÑÈ ÓÌÅÄÕÀÃÃ…Ã…:
> news:00AC182A-503F-430C-9F49-4AC609F36E2E@microsoft.com...
> > Hi,
> >
> > can somebody help me out with a (working ) example of the Ibuttoncontrol
> > on
> > f.i. a textbox, so if the users uses the enter key on the textbox, an
> > event
> > (msgbox) is showed
> >
> > Thx!!
> > --
> > Best regards
> > Luc
>
>