T
Tomer
Hi,
I need to have a KeyPress event for the combobox so I've created a new
control that inherits a combobox and overrided the keypress event
the code goes like this:
using System;
using System.Windows.Forms;
using System.Drawing;
#if NETCFDESIGNTIME
using System.ComponentModel;
#endif
#if NETCFDESIGNTIME
[assembly: System.CF.Design.RuntimeAssemblyAttribute("ExComboBox,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")]
#endif
namespace New.Controls
{
/// <summary>
/// ExComboBox Class
/// </summary>
public class ExComboBox : System.Windows.Forms.ComboBox
{
#region Vars
#endregion
/// <summary>
/// KeyPress event
/// </summary>
public new event KeyPressEventHandler KeyPress;
#region Constructors/Destructors
#endregion
/// <summary>
/// Constructor
/// </summary>
public ExComboBox()
{
// hookup events
this.KeyPress += new KeyPressEventHandler(this.OnKeyPress);
}
#region Functions
#endregion
#region Events
#endregion
/// <summary>
/// ComboBox OnKeyPress Event
/// </summary>
private void OnKeyPress(object sender, KeyPressEventArgs e)
{
base.OnKeyPress(e);
}
#region Properties
#endregion
}
}
now, this doesn't do the trick! I've also tried adding [Browsable(true)]
before the event code, but i get a compilation error that I am missing an
assembly or a reference (have no idea why)
Any help would be greatly appreciated! Tomer.
I need to have a KeyPress event for the combobox so I've created a new
control that inherits a combobox and overrided the keypress event
the code goes like this:
using System;
using System.Windows.Forms;
using System.Drawing;
#if NETCFDESIGNTIME
using System.ComponentModel;
#endif
#if NETCFDESIGNTIME
[assembly: System.CF.Design.RuntimeAssemblyAttribute("ExComboBox,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")]
#endif
namespace New.Controls
{
/// <summary>
/// ExComboBox Class
/// </summary>
public class ExComboBox : System.Windows.Forms.ComboBox
{
#region Vars
#endregion
/// <summary>
/// KeyPress event
/// </summary>
public new event KeyPressEventHandler KeyPress;
#region Constructors/Destructors
#endregion
/// <summary>
/// Constructor
/// </summary>
public ExComboBox()
{
// hookup events
this.KeyPress += new KeyPressEventHandler(this.OnKeyPress);
}
#region Functions
#endregion
#region Events
#endregion
/// <summary>
/// ComboBox OnKeyPress Event
/// </summary>
private void OnKeyPress(object sender, KeyPressEventArgs e)
{
base.OnKeyPress(e);
}
#region Properties
#endregion
}
}
now, this doesn't do the trick! I've also tried adding [Browsable(true)]
before the event code, but i get a compilation error that I am missing an
assembly or a reference (have no idea why)
Any help would be greatly appreciated! Tomer.