floele
Joined: 04 Aug 2008 Posts: 22
|
Posted: Fri Oct 08, 2010 2:18 pm Post subject: Bug in GetToolTipTest |
|
|
Hi,
GetToolTipText() always does the following:
result = String.Format(ToolTip, Value)
This is prone to errors. For example, if you set the tooltip to "Sehr geehrt{-er/-e} ..." expecting to only see plaintext as tooltip, a FormatException occurs because of the braces in the text.
Conclusion: The ToolTip property should not use Format() by default.
Code: |
public virtual string GetToolTipText()
{
string result = null;
if (ToolTip == null)
result = GetText();
else
result = String.Format(ToolTip, Value);
return result;
}
|
|
|