473,626 Members | 3,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

InnerXml in ToolTip

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_Mous eMove(object sender,
System.Windows. Forms.MouseEven tArgs e){
string strTemp="";
int i=0;
TreeNode tn = this.tvTreeView .GetNodeAt(e.X, e.Y);
if(tn !=null) {
int currentNodeInde x = tn.Index;
if (tn.Text !="subreport" ) return;
if(currentNodeI ndex != oldNodeIndex){
oldNodeIndex = currentNodeInde x;
if(this.tooltip General != null && this.tooltipGen eral.Active)
this.tooltipGen eral.Active = false; //turn it off
XmlDocument sourceDoc = new XmlDocument();
sourceDoc.Load( this.txtFilenam e.Text);
XmlNodeList subreportNodes = sourceDoc.Docum entElement.Chil dNodes;
foreach (XmlNode subreportNode in subreportNodes)
{
if ( i==currentNodeI ndex)
{
strTemp=subrepo rtNode.InnerXml ;
break;
}
}
else i++;
}
this.tooltipGen eral.SetToolTip (this.tvTreeVie w, strTemp);
this.tooltipGen eral.Active = true; //make it active so it can show
}
}
}
Nov 16 '05 #1
1 2538
ALI,

You would have to do the formatting yourself.

If you want to do some simple formatting, why not read the current
element, then increment an indent counter (which you keep yourself) when you
move to read the child nodes, and so on, and so on. Then, when done reading
the child nodes, you decrement the indent counter.

Then, you would write out the contents of the node (not the inner xml,
but the node itself), and then prefix the line with the a number of tabs
equal to the indent counter.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"ALI-R" <ne****@microso ft.com> wrote in message
news:O9******** *****@TK2MSFTNG P12.phx.gbl...
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_Mous eMove(object sender,
System.Windows. Forms.MouseEven tArgs e){
string strTemp="";
int i=0;
TreeNode tn = this.tvTreeView .GetNodeAt(e.X, e.Y);
if(tn !=null) {
int currentNodeInde x = tn.Index;
if (tn.Text !="subreport" ) return;
if(currentNodeI ndex != oldNodeIndex){
oldNodeIndex = currentNodeInde x;
if(this.tooltip General != null && this.tooltipGen eral.Active)
this.tooltipGen eral.Active = false; //turn it off
XmlDocument sourceDoc = new XmlDocument();
sourceDoc.Load( this.txtFilenam e.Text);
XmlNodeList subreportNodes = sourceDoc.Docum entElement.Chil dNodes;
foreach (XmlNode subreportNode in subreportNodes)
{
if ( i==currentNodeI ndex)
{
strTemp=subrepo rtNode.InnerXml ;
break;
}
}
else i++;
}
this.tooltipGen eral.SetToolTip (this.tvTreeVie w, strTemp);
this.tooltipGen eral.Active = true; //make it active so it can show
}
}
}

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
7608
by: Philipp Lenssen | last post by:
Why isn't there a way in standard DOM to access all XML of a node? (Similar to what outerHTML and innerHTML can do on Firefox or Internet Explorer when accessing HTML.) Or am I missing something? -- Google Blogoscoped http://blog.outer-court.com
3
3875
by: Martin Madreza | last post by:
hello, i despair on one simple problem (maybe it's to simple???) I have the string txt = "hallo</hmm>" or txt = "am&24" and want to pass it to the XmlNode InnerXml property myNode.InnerXml = txt //error
3
3942
by: Bas Jaburg | last post by:
I'm creating a Windows App in C#(Smart Client)that calls a webservice. The webservice returns this: <?xml version="1.0" encoding="utf-8" ?> <table id="klasse" records="4792"> <record locator="1"> <KlaKey>04424</KlaKey> <KlaOms>(Niet in gids of internet)</KlaOms> </record> <record locator="2">
0
1533
by: Yves Royer | last post by:
Hi, I'm currently writing an application (in VS 2005 bèta 2) and made some own user controls. In each user control I added a ToolTip object so i can set some tooltips on checkboxes etc. What I wanted to do is to add a ToolTip object on the starting form, and pass this ToolTip object to the user controls. In each user control I created a property ToolTip with only a setter which accepts the passed ToolTip.
0
1563
by: Yves Royer | last post by:
Hi, My first post didn't show up so here's a second try. I'm currently writing an application (in VS 2005 bèta 2) and made some own user controls. In each user control I added a ToolTip object so i can set some tooltips on checkboxes etc. What I wanted to do is to add a ToolTip object on the starting form, and pass this ToolTip object to the user controls. In each user control I
5
9817
by: =?Utf-8?B?cGV0ZTE5Njk=?= | last post by:
I use Visual Studio 2005 and created a very simple Form with one button. I added a Tooltip for that button. It shows fine the first time I hover over that button. But if I let it disappear by the maximum time it should be displayed, it never shows again over that button. Is that intended? And what can I do to make it show again?
2
11950
by: =?Utf-8?B?c2VlbWE=?= | last post by:
What is the differnce between outerXML and innerXML.
16
2769
by: Charles Law | last post by:
I have to take this personally now. Tooltips have been flakey since the dawn of .NET, but to still have to put up with a disappearing tooltip in VS 2008 is getting beyond a joke. Tooltips have always done this, so isn't it about time they were fixed? I have a tooltip that I assign to a button control on my form. I hover over the button and up pops the tooltip. I move away and the tooltp fades. I hover again, and back comes the tooltip....
4
6794
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... I just noticed something that seems counter-intuitive to me. By default an XmlDocument is set with PreserveWhitespace=false. This means that XmlDocument.Load() or .LoadXml() will strip/condense non-semantic whitespace. *But* I just found that if you take that self-same XmlDocument and do either XmlDocumentFragment node = doc.CreateDocumentFragment(); node.InnerXml = "<foo/>\r\n<bar/>";
0
8202
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8641
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.