C#
-
How to get all folders , subfolders and forms of my project !
-
How to get all folders , subfolders and forms of my project !
You are risking being booted from this site. Read this and follow the guidelines. http://www.codeproject.com/Messages/1278604/How-to-get-an-answer-to-your-question.aspx[^]
I know the language. I've read a book. - _Madmatt
-
You are risking being booted from this site. Read this and follow the guidelines. http://www.codeproject.com/Messages/1278604/How-to-get-an-answer-to-your-question.aspx[^]
I know the language. I've read a book. - _Madmatt
WHY
?:mad: -
How to get all folders , subfolders and forms of my project !
If you feel the need to do something like this, you have a serious, serious design flaw in your application.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
If you feel the need to do something like this, you have a serious, serious design flaw in your application.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...I wanna this(all subfolders and forms) and fill in treeview and then when i click on any form in subfolder or anywhere it returns all controls in that form ! So who can i do that !?
-
WHY
?:mad:jojoba2010 wrote:
WHY?
Your title means nothing and your question means little more. Try reading some books on C# and .NET, and doing some research, and then come back with a sensible question that refers to something you have actually done for yourself. If you are using these questions to learn how to write a program you are wasting everyone's time, including your own.
MVP 2010 - are they mad?
-
WHY
?:mad:If you read the link provided, you would notice that, 1) your topic is less than clear 2) you're asking "how do I do this" without any comments on what you have tried so far etc. The forums are for assistance with what you're working on, not for people to give you the work. you should post, Topic: Subfolders and Files Content: I am working on a project to and I'm trying to figure out how to <>. I've tried x, y and z, but I've not had much luck. Can anybody see what I'm doing wrong, or point me in the right direction please?
-
jojoba2010 wrote:
WHY?
Your title means nothing and your question means little more. Try reading some books on C# and .NET, and doing some research, and then come back with a sensible question that refers to something you have actually done for yourself. If you are using these questions to learn how to write a program you are wasting everyone's time, including your own.
MVP 2010 - are they mad?
If you think something like this ,I am sorry for you ? My Question : I wanna this(all subfolders and forms) and fill in treeview and then when i click on any form in subfolder or anywhere it returns all controls in that form ! So who can i do that !?
-
If you read the link provided, you would notice that, 1) your topic is less than clear 2) you're asking "how do I do this" without any comments on what you have tried so far etc. The forums are for assistance with what you're working on, not for people to give you the work. you should post, Topic: Subfolders and Files Content: I am working on a project to and I'm trying to figure out how to <>. I've tried x, y and z, but I've not had much luck. Can anybody see what I'm doing wrong, or point me in the right direction please?
Thanks dear ! SORry?! So whats you idea !? I have tried :
public void PopulateTree(string dir, TreeNode node)
{// get the information of the directory DirectoryInfo directory = new DirectoryInfo(dir); // loop through each subdirectory foreach (DirectoryInfo d in directory.GetDirectories()) { if (d.Name != "bin" && d.Name != "obj" && d.Name != "Properties") { // create a new node TreeNode t = new TreeNode(d.Name); // populate the new node recursively PopulateTree(d.FullName, t); node.Nodes.Add(t); // add the node to the "master" node } } // lastly, loop through each file in the directory, and add these as nodes foreach (FileInfo f in directory.GetFiles()) { string\[\] Count = f.Name.Split('.'); // create a new node if (Count.Length == 2 && f.Extension == ".cs" && f.Name != "Program.cs") { TreeNode t = new TreeNode(f.Name); // add it to the "master" node.Nodes.Add(t); } } }
private void btnGenerate_Click(object sender, EventArgs e)
{
treeView1.Nodes.Add("Resource Generator");
// PopulateTree(@"G:\Resource Final Editor For JahanBane\ResourceGenerator(FINISHED FINAL)\ResourceGenerator", treeView1.Nodes[0]);
PopulateTree(@"F:\AliWinTAP\WinTAP", treeView1.Nodes[0]);
} -
If you think something like this ,I am sorry for you ? My Question : I wanna this(all subfolders and forms) and fill in treeview and then when i click on any form in subfolder or anywhere it returns all controls in that form ! So who can i do that !?
jojoba2010 wrote:
If you think something like this ,I am sorry for you ?
Why be sorry for me, I have no problem? I was merely pointing out that the subject "C#" in your question tells us nothing. Try something like "Help with TreeView" as a more descriptive type. Also your question suggests that you need to study .NET and C# in more depth as your request is for a full function TreeView implementation which populates from a directory structure. This in itself is not that difficult if you try studying the control itself, or do a Google search, or take a look at the articles here on CodeProject.
MVP 2010 - are they mad?
-
WHY
?:mad:.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
I wanna this(all subfolders and forms) and fill in treeview and then when i click on any form in subfolder or anywhere it returns all controls in that form ! So who can i do that !?
Are you writing an AddIn for Visual Studio? Or are you trying to get all the form Name properties or your own application at runtime?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Are you writing an AddIn for Visual Studio? Or are you trying to get all the form Name properties or your own application at runtime?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...My own Application Only !?
-
How to get all folders , subfolders and forms of my project !
use System.IO namespace DirectoryInfo,FileInfo and DriveInfo are the classes which can help
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
My own Application Only !?
Since your project doesn't exist at runtime, there's no subfolders or form files or anything else. You'll have to use Reflection to find all of the classes that decend from the Form class. But, you have another problem. At runtime, the controls on a form do not exist until you create an instance of the form. ONLY then will they show up.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...