I am showing the InnerXml of a node (in a treeView Control) in a tooltip
,but it is not formatted well ,all the elements after each other ,is there a
way to format the innertext in a tooltip.
=========Code==========
private void tvTreeView_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e){
string strTemp="";
int i=0;
TreeNode tn = this.tvTreeView.GetNodeAt(e.X, e.Y);
if(tn !=null) {
int currentNodeIndex = tn.Index;
if (tn.Text !="subreport") return;
if(currentNodeIndex != oldNodeIndex){
oldNodeIndex = currentNodeIndex;
if(this.tooltipGeneral != null && this.tooltipGeneral.Active)
this.tooltipGeneral.Active = false; //turn it off
XmlDocument sourceDoc = new XmlDocument();
sourceDoc.Load(this.txtFilename.Text);
XmlNodeList subreportNodes = sourceDoc.DocumentElement.ChildNodes;
foreach (XmlNode subreportNode in subreportNodes)
{
if ( i==currentNodeIndex)
{
strTemp=subreportNode.InnerXml;
break;
}
}
else i++;
}
this.tooltipGeneral.SetToolTip(this.tvTreeView, strTemp);
this.tooltipGeneral.Active = true; //make it active so it can show
}
}
}