[csharp]
private void cboImportset_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
// Catch the enter keypressed
if (e.KeyChar = Keys.Enter)
// {
// Check if ImportSet already exists if so select ImportSet.
// if ImportSet doesn' exists add it to ImportSet list.
MessageBox.Show(e.KeyChar.ToString());
// }
[/csharp]
Errors are:
- Cannot implicitly convert type 'char' to 'bool'
- Property or indexer 'System.Windows.Forms.KeyPressEventArgs.KeyChar'
cannot be assigned to -- it is read only
- Cannot implicitly convert type 'System.Windows.Forms.Keys' to 'char'
private void cboImportset_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
// Catch the enter keypressed
if (e.KeyChar = Keys.Enter)
// {
// Check if ImportSet already exists if so select ImportSet.
// if ImportSet doesn' exists add it to ImportSet list.
MessageBox.Show(e.KeyChar.ToString());
// }
[/csharp]
Errors are:
- Cannot implicitly convert type 'char' to 'bool'
- Property or indexer 'System.Windows.Forms.KeyPressEventArgs.KeyChar'
cannot be assigned to -- it is read only
- Cannot implicitly convert type 'System.Windows.Forms.Keys' to 'char'
Last edited: