FolderBrowserDialog

FolderBrowserDialog

Moshe-A
Mentor Mentor
3,308 Views
12 Replies
Message 1 of 13

FolderBrowserDialog

Moshe-A
Mentor
Mentor

Hi Guys,

 

i'm writing a small c# program that creates a script file to be run from outside AutoCAD and have this issue:

(the script will be running on series of dwg files)

 

FolderBrowserDialog class (see the picture) under Microsoft VS 2015 comunity version

i would like to change the Captain text + delete the extra empty line in the Description field and i can not find how?

(can not find the fields to change in the properties pane for the FolderBrowserDialog in VS)

 

 

thanks in advance

Moshe

 

   

0 Likes
Accepted solutions (1)
3,309 Views
12 Replies
Replies (12)
Message 2 of 13

fieldguy
Advisor
Advisor

Maybe you can?  I have not tried this.  >>here<< 

 

That's probably easier than creating your own. >>here<<

0 Likes
Message 3 of 13

Moshe-A
Mentor
Mentor

thanks Fieldguy

 

it looks like heavy solution to simple problem

 

what about deleting the empty description line?

 

i will try that later and inform here

 

 

0 Likes
Message 4 of 13

fieldguy
Advisor
Advisor

i agree with the heavy solution to a simple problem.  maybe there is public domain library that offers an alternative. it looks like the WPF control offers more flexibility but i could be wrong.

 

there is an alternative >>here<<

 

>>what about deleting the empty description line?<<

 

i don't think you can.  i believe the height of the space between the title and the tree view will never change (if that's what you are referring to) - regardless of the length of the text (0 to many characters). the few form controls are anchored top left and the description field text wraps.

Message 5 of 13

Moshe-A
Mentor
Mentor

fieldguy,

 

check (acet-ui-pickdir) lisp function from express tools, this one let us do exactly what i want.

 

Moshe

 

0 Likes
Message 6 of 13

fieldguy
Advisor
Advisor

you should mark your solution as accepted

0 Likes
Message 7 of 13

Moshe-A
Mentor
Mentor

Solusion? i still not have it

 

(acet-ui-pickdir) is inside AutoCAD, my program is from outside AutoCAD

and if there is a way to use this function from outside, i do not know how

 

 

 

 

 

0 Likes
Message 8 of 13

_gile
Consultant
Consultant

Hi,

 

 

            var browser = new FolderBrowserDialog();
            browser.ShowNewFolderButton = false;
            browser.ShowDialog();

displays the same as (acet-ui-pickdir)

 

folder_browser_1.png

 

 

 

            var browser = new FolderBrowserDialog();
            browser.Description = "Some description";
            browser.ShowNewFolderButton = false;
            browser.ShowDialog();

displays the same as (acet-ui-pickdir "Some description")

 

folder_browser_2.png



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 9 of 13

Moshe-A
Mentor
Mentor

sorry _glie but this is not exactly right. here the (acet-ui-picdir) format:

 

(acet-ui-pickdir [message [startDir [caption]]])

Displays a directory selection dialog.

Arguments
message: If provided, a message to be displayed in the space above the directory tree control. 
startDir: If provided, the initial directory to be selected. 
caption: If provided, the dialog caption. 

Return Values
A string containing the name of the selected directory, or nil if the dialog was canceled.

 

i agree we can change the description but i am looking for captain args

 

this is how i want  FolderBrowserDialog to be  (picture from acet-ui-pickdir )

(note that decripton field has only 1 line where FolderBrowserDialog displays 2 lines)

 

 

browse.jpg

 

thanks

Moshe

 

 

0 Likes
Message 10 of 13

_gile
Consultant
Consultant

As far as I know, there's no way to change the caption/title of the System.Windows.Forms.FolderBrowserDialog.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 11 of 13

Moshe-A
Mentor
Mentor
Accepted solution

thank you

 

0 Likes
Message 12 of 13

zputman
Explorer
Explorer

I use the CommonOpenFileDialog from the Windows 7 API Code Pack on NuGet.  It was published by Microsoft and I have had no problems with it.  The dialog looks like the picture below.  I hated not having the address bar or favorites of the other options.

 

image.png

Message 13 of 13

BKSpurgeon
Collaborator
Collaborator

Yes this can't be understated:

 

otherwise the select folder dialog box will open up at the root folder and that too, without menus and favourites. If this is repetitive action, it will grow old, very quickly.

 

This stack overflow answer was particularly helpful:

 

https://stackoverflow.com/a/41511598/4880924

0 Likes