|
foreach (Node ndSource in treeSource.Nodes)
{
Node newNode = new Node();
newNode.Text = ndSource.Text;
-- copy all required properties like the text property above --
ChildNodes(ndSource, newNode);
treeDestination.Nodes.Add(newNode);
}
private void ChildNodes(Node ParentNode, Node newParent)
{
foreach (Node ndChild in ParentNode.Nodes)
{
Node newNode = new Node();
newNode.Text = ndChild.Text;
-- copy all required properties like the text property above --
ChildNodes(ndChild);
newParent.Nodes.Add(newNode);
}
}
|
|
|
|
|
A node can't exist in two treevies at once. Each node has to be cloned first so some sort of loop is inevitable. Two code snippets below. The first does what you want but with a loop. The second moves the nodes rather than copies but no loop required.
if (treeView1.Nodes.Count > 0)
{
TreeNodeCollection treeNodes = treeView1.Nodes;
TreeNode[] nodearray = new TreeNode[treeNodes.Count];
for (int i = 0; i < nodearray.Length; i++)
{
nodearray[i] = (TreeNode)treeNodes[i].Clone();
}
treeView2.Nodes.AddRange(nodearray);
}
if (treeView1.Nodes.Count > 0)
{
TreeNodeCollection treeNodes = treeView1.Nodes;
TreeNode[] nodearray = new TreeNode[treeNodes.Count];
treeNodes.CopyTo(nodearray, 0);
treeView1.Nodes.Clear();
treeView2.Nodes.AddRange(nodearray);
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
but i think to use AddRang function.
sepel
|
|
|
|
|
Hello everyone,
I want to monitor the WCF/web services communication between client and server to serve better debugging purpose.
Any tools? I could use sniffer, but not quite friendly to show SOAP message format.
thanks in advance,
George
|
|
|
|
|
With .NET 2.0 you could use a feature in WSE3 that was tracing SOAP traffic between server and client. Myself, I use a third party program called HttpAnalyzer which served me well.
|
|
|
|
|
Thanks blackjack2150,
1.
To use WSE3, I think it is an SDK, and we need to write code, correct (i.e. not a ready to use tool)?
2.
I made some study for HttpAnalyzer, looks like a sniffer tool for Http traffic, similar to Microsoft Fiddler2?
regards,
George
|
|
|
|
|
Hi there,
I have written a c# application (VS2005) for a windows CE 5.0 device (Psion 8515) with a screen/res
of 6.4", 640 x 480.
I had to make chunky controls on the forms for the tractor drivers to be able to touch screen easaly without using a stylus.
I now need to load the same application on a much smaller Pocket PC (Psion workabout
Display 3.5" Resolution: 240 x 320) without having to redesign all the forms, buttons etc...
The application runs fine on the Workabout but does not automatically resize the forms and controls.
I end up with a scrolling screen.
Never did that before, does anyone have a solution, direction to take?
Very much appreciated
Thanks
Scalpa
|
|
|
|
|
I want to insert an image in the header of the WORD document through C#. The word document initially gets created through code only. When I try to access "oWordApplic.Selection.HeaderFooter", it shows "null". Not sure how to create a HeaderFooter object and insert an image into it.
private Word.ApplicationClass oWordApplic;
oWordApplic = new Word.ApplicationClass();
|
|
|
|
|
try
Section.Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields.Add
Here[^] is a good article on word automation.
"If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry
|
|
|
|
|
Thanks for the information. This has indeed helped me to overcome this issue.
More information was posted at below link.
http://msdn.microsoft.com/en-us/library/ms178795.aspx
|
|
|
|
|
how to make "yahoo answers" website like paging list control(horizontal list with page nos in boxes style) in C# windows application..
In this type of control i wanna generate list of page nos dynamically..with proper style like hover.
example can also be seen in windows live search results at microsoft website. pl suggest solution for this..
|
|
|
|
|
Hai frnds,
Here is my html file : Test.html
<html><body> <table> <tr> <td><img src="$image$"/></td> <td> $title$</td> </tr> </table></body></html>
This is my C# code
string strImage = "TestImage.gif";
string strTitle = "HTML File";
string strMailBody = createMailBody("Test.html");
strMailBody = strMailBody.Replace("$image$", strImage);
strMailBody = strMailBody.Replace("$title$", strTitle);
Iam using this to send a mail. Problem is, at the receiver end image doesn't display. How to solve this?
Thanks in advance
Praji
|
|
|
|
|
Do you include the image as an attachment? Otherwise you need to use a complete url, or the mail program don't know where to look for the image.
Despite everything, the person most likely to be fooling you next is yourself.
modified on Tuesday, October 7, 2008 6:33 AM
|
|
|
|
|
Hi,
I have created 3 C# application using Visual studio 2008. I want to create an installer that holds the following things:
1. A text file
2. Three .exe for each C# application
The installer should run these three .exe. I need to deploy this on the target machine. Please help!! Let me know if any further detail is required.
Cheers!
Ethen
|
|
|
|
|
You can just add the file in a setup project and it will be delivered with the setup. If you want to run code in your setup, create Installers and add them in the custom actions view of your setup project.
|
|
|
|
|
Hi,
How can we communicate with linux server from .net application? I need to upload/download files to linux server using .net desktop/web application preferably using sftp.
-Thanks,
Priya.
|
|
|
|
|
Hi all..
I am trying to get the actual URL of the List Items but i am not able to get it ,each time getting something like..(_1.000) extension but it is unable to open the required list..
I am trying with the below code..
SPList contactsList = myWeb2.Lists[list.Title];
foreach (SPListItem contact in contactsList.Items)
{
MessageBox.Show("URL:"+contact.Url);
}
any help...
thank you
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
hi,
i have a form for my device applicaation(PDA) in which i have a datatable. i have to freeze the first column of the datatable. i mean dock the first column so that when he scrolls, first column does not moves along with scroll.
for datagrid view there is a frezze property, but i was not able to find such property for datatable.
can some one help in reagrds with this.
|
|
|
|
|
How do I make a form implement an interface?
Everything makes sense in someone's mind
|
|
|
|
|
Forms are normal classes. So you can implement an interface as usual.
|
|
|
|
|
You may be having trouble because your form class is already "implementing" the Form class. What you need to do is enter a , after the Form declaration and type your interface name there. Example:
partial class myForm : Form, myInterface
{}
Cheers!
Richard Blythe
I've used up all my sick days, so today I'm calling in dead.
|
|
|
|
|
Richard Blythe wrote: form class is already "implementing" the Form class
Nope its inheriting. You inherit base clases you implement interfaces.
|
|
|
|
|
Thanks for the correction.
I've used up all my sick days, so today I'm calling in dead.
|
|
|
|
|
What would be the easiest way of drawing rectangles or other shapes onto a picture box using the mouse?
Just like in MS Paint.
|
|
|
|
|
this[^] might help
While (true) { Human.isLearnable = true; }
|
|
|
|