Problems dynamically changing helpstring for combobox.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am setting the helpstring for all interesting controls to a default in the
form load method. I am then using the SelectedIndexChanged of a combobox to
dynamically change the help displayed using the popup menu, F1, and the
toolltip depending on the currently selected item in the control. I pull
details from the item in the currently selected combobox item so the user can
optionally see more information about the item they are selecting. I have
two questions about this:

1. Why does the tooltip text change, but not the test that is displayed
when I use F1.

2. Is there some way to stop the tooltip from popping up momentarily when
the helpstring is changed in code?

This is a snippet of the code I'm using to change the helpstring.

// Construct the help from the information about the ammo type
// currently selected.
this.helpProvider1.SetHelpString(this.cboHEAT, <A bunch of stuff >)
this.toolTip1.SetToolTip(this.cboHEAT,
helpProvider1.GetHelpString(this.cboHEAT));
 
I can't reproduce your first problem, but you can solve #2 (which I can
replicate), by setting the tooltip to inactive before you change it, and
then reactivating it. Using your code snippet, it would read:

// Construct the help from the information about the ammo type
// currently selected.
this.helpProvider1.SetHelpString(this.cboHEAT, <A bunch of stuff >)
this.toolTip1.Active = false;
this.toolTip1.SetToolTip(this.cboHEAT,
helpProvider1.GetHelpString(this.cboHEAT));
this.toolTip1.Active = true;
 
Thanks for the reply. Your suggestion worked as advertised. I did something
like that before without success, but I can't remember what it was and it
apparentky wasn't what you suggested.

I still have the first problem, so if anybody else has any ideas let me know
please.
 
Try changing your <A bunch of stuff> into something simple, like the
cboHeat.SelectedIndex.ToString(). This will tell you whether the problem is
in your bunch of stuff...
 
Back
Top