what is wrong with this

  • Thread starter Thread starter GS
  • Start date Start date
G

GS

somewhere towards end of the form calls I have

private void setRegexoptionsChkBoxOnPosnChgd(object sender, ConvertEventArgs
cevent)
{
if ((cevent.Value == DBNull.Value))
{
cevent.Value = "";
}
else
{
//@@todo
}
}

in myform_load event (called from teh form constructor after
InitializeComponent) I have

Binding regexoptionBinding = textBoxRegexOptions.DataBindings[1];
regexoptionBinding.Format += new
System.EventHandler(this.setRegexoptionsChkBoxOnPosnChgd);

I got the message
Error 2 No overload for 'setRegexoptionsChkBoxOnPosnChgd' matches delegate
'System.EventHandler' c:\RegexParse2CSV\RegexParse2Csv.cs 184 42
RegexParse2CSV

where have I gone wrong?

thank you for your time and insight.
 
The line:

regexoptionBinding.Format += new
System.EventHandler(this.setRegexoptionsChkBoxOnPosnChgd);

Should be:

regexoptionBinding.Format += new
System.ConvertEventHandler(this.setRegexoptionsChkBoxOnPosnChgd);

As the Format event exposes a delegate with that signature, not the
signature of EventHandler.
 
thank you. changing to
regexoptionBinding.Format += new
ConvertEventHandler(this.setRegexoptionsChkBoxOnPosnChgd);

works wonderfully



Nicholas Paldino said:
The line:

regexoptionBinding.Format += new
System.EventHandler(this.setRegexoptionsChkBoxOnPosnChgd);

Should be:

regexoptionBinding.Format += new
System.ConvertEventHandler(this.setRegexoptionsChkBoxOnPosnChgd);

As the Format event exposes a delegate with that signature, not the
signature of EventHandler.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


GS said:
somewhere towards end of the form calls I have

private void setRegexoptionsChkBoxOnPosnChgd(object sender,
ConvertEventArgs
cevent)
{
if ((cevent.Value == DBNull.Value))
{
cevent.Value = "";
}
else
{
//@@todo
}
}

in myform_load event (called from teh form constructor after
InitializeComponent) I have

Binding regexoptionBinding = textBoxRegexOptions.DataBindings[1];
regexoptionBinding.Format += new
System.EventHandler(this.setRegexoptionsChkBoxOnPosnChgd);

I got the message
Error 2 No overload for 'setRegexoptionsChkBoxOnPosnChgd' matches delegate
'System.EventHandler' c:\RegexParse2CSV\RegexParse2Csv.cs 184 42
RegexParse2CSV

where have I gone wrong?

thank you for your time and insight.
 
Back
Top