My ultimate goal is to allow a user to select what directories they want as a checkbox type thing. Can I display a drill down directory structure with checkboxes next to each folder using this control or should I got a different route?
Edit: More Information.
I have a Windows Form application in Visual Studio using c#.
It is to allow myself and some select friends automatically backup folders to amazon s3 on a daily basis.
I need to figure out how to display a computers directory structure which you can drill down into and check a box next to any folder you want.
That way the app will only backup folders you choose.
A CheckBoxList seems like the right way to go but I can't figure out how to make it a drilldown list. It seems to only display a list of items. What is another control I could try or another method I could explore?
if you need to show a hierarchy just use a TreeView with checkboxes.
you are not telling if you are in Windows Forms, WPF, ASP.NET, MVC etc... still there should be such "checkboxable" TreeView in all these platforms.
A CheckedListBox displays a flat structure. A TreeView would be more appropriate to present a nested directory structure.
Related
In short, im creating a Visual Studio extension in c# that enables non-automation testers to create automation scripts for web based solutions (using selenium).
We've created a template already for users that lays out the project file structure (test runners etc) and im using windows forms toolbox controls to create the dialogue windows where they will enter things like URls, Xpaths, page names etc etc
My question is this;
How on earth do i go about creating .CS files dynamically based on their inputs in these toolbox windows?
The simplest (he says) window i have is one that simply allows them to enter a URl and a webpage name. When they click the 'ok' button on this window, it should create a new .CS file with the webpage name as the class name, the url as a string that the webdriver can use to kick off the test and a few other bits and pieces as a template for them to start adding web elements to.
Any guidance would be greatly appreciated, there seems to be precious little around the web about creating VS extensions!
You got a few options here.
Typically, most people would do this by implementing a custom project item template, along with a custom IWizard based wizard associated with your template.
If you are displaying a modal UI from your IWizard.RunStarted, you can simply populate the ReplacementsDictionary with the text gleaned from your custom UI, which would then be swapped for the tokens in your templatized .cs file.
Or you could programmatically add code to the file after it was generated and added to the project (admittedly a much uglier and more difficult to code).
And finally, you could just generate the file in the project directory, and programmatically add it after the fact.
There's a number of old blog articles from the archived VSX Arcana blog that you might also find helpful.
In my c# windows application, I like to get multiple files with a same order as user select the file in openfiledialog window. I'm getting all the selected file but its order is not correct. Anyone help me to solve this problem.
If you look at the documentation for the underlying control's interface OPENFILENAME, you'll see this comment:
If the user selects more than one file, the lpstrFile buffer returns the path to the current directory followed by the file names of the selected files.
And, other than some comments on the separator characters used for different scenarios, what to do if there's not enough buffer, and some details on legacy 8.3 support, that's it. In other words, the OpenFileDialog doesn't offer any mechanism to bubble up the sort information as the underlying Windows Common Dialog Box doesn't offer anyway to get this information out via a standard interface.
If you must preserve it, you'll need to create your own Form or Dialog to track the selection in order, and honestly you'll probably be better off providing an slightly different UI that allows the user to reorder files after they've selected them, similar to how one can reorder lists on some mobile devices.
I have a VS Solution in that my project contains something around 160 Forms. Now I want to get the Control's text property from all the forms.
Why I want to do is my application is in English Language. My client asked me to convert the whole software into other languages also. Now he wants me to provide him list of all menu and other controls in a Excel or XML sheet from where he will translate everything.
SO is there any mechanism available which can read all of my forms and its control and save text/caption of every item in a external file or may be in any medium.
Is it possible. Looking for fellow support. Regards.
ADD1:
Like I have a MDI form and its designer contains this.mnu_recycle.Text = "Recycle";
Likeways we have n number of .Text items. I just want a list of all of them.
Create some code that creates an instance of each form then loops through all the controls getting the text and name of the control. Write the info (Form name, control name, control text) to a csv file or generate a resource file which can be translated. You can then write a small app to change the form code files to use resource files.
Programmatically creating a resource file
http://msdn.microsoft.com/en-us/library/gg418542.aspx
Resource files will make your application be easier to translate to other languages take a look at these
C#: How to bind the text of a winforms button to a resource
What would be the easiest way to generate new localized resource files?
How to load C# winform strings from resource file without rebuild
I am new to this and i have a small task. I want to access the control panel items, perform search and display their name, description and task lists etc what ever I can access in my window. Something similar to what windows explorer search does.
This is what I have done till now. I followed the approach here and I am able to access the cpl files in System folder. But they are not all the cpl files. And hence my result ends up being a subset of the desired result set.
Also by accessing the cpl files I do not get the task list and other details which are valuable in my search operation. Please see image for the result i want
This result appears when i search for display inside the control panel explorer.
What else should I try? Can someone guide me?
Thank you in advance.
I have a tutorial to implement "My Own ILDASM" , may I know what approach i can use.
I have visual studio 2010 installed on my computer , i added MenuStrip and OpenFIleDialog.
My Questoins
1) I need to add a treeview control to display type members hierarchy in a tree
any direction will be enough
after selecting a dll from winform , how can i show that dll info in the tree view.
Any info will be appreciated.
First, bone up on reflection.
Then, build up the namespaces and have those as top level tree view items. Next get all the Types. For example: Assembly.GetTypes.
From here you should be getting the hang of it. For each type, get the methods, properies, fields etc and make the subnodes.