I am experiencing some difficulties using the HelpProvider class.
If I have the following code in the constructor of my form then the
help
string "Help Text" gets shown when I click the question mark button on
the dialog
and then click the cEdit control
helpProvider.SetShowHelp(cEdit,true);
helpProvider.SetHelpString(cEdit,"Help Text");
As the helptext is coming from a datasource, I want to get the help
text on demand. Therefore, I change the code to be as follows:
cEdit.HelpRequested += new
HelpEventHandler(this.cEdit_OnHelpRequested);
protected void cEdit_OnHelpRequested(object sender,
System.Windows.Forms.HelpEventArgs hlpEvent)
{
helpProvider.SetShowHelp(cEdit,true);
helpProvider.SetHelpString(cEdit,"Help Text"); // ie normally gets
from a datasource
}
However, what happens now is that only on the second and subsequent
button clicks do I see the help string.
Can anyone offer any suggestions/recommendations on how to fix or
workaround the issue?