.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Easy way to ask for file and directory paths?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks.
Re: Easy way to ask for file and directory paths?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
FolderBrowserDialog would be very easy.
"namin" wrote in message news:5817613@discussion.autodesk.com...
Is there an easy way to ask the user for a directory or file, for saving or
opening?
Thanks.
Re: Easy way to ask for file and directory paths?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
The System.Windows.Forms namespace is a lot easier to use though...
Re: Easy way to ask for file and directory paths?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
so to add the control “OpenFileDialog" you drag the control from the tool box to a form "Form1.vb"....correct?
now how do you access the method from a different class "myCommand.vb"
example I have a form1.vb that has the control “OpenFileDialog" named OpenFD.
I then have myCommands,vb where I want to access OpenFD.
how do I do that?
Private Sub getfilename()
openFD.InitialDirectory = "C:\"
openFD.Title = "Open a Text File"
openFD.Filter = "Text Files|*.txt"
openFD.ShowDialog()
End Sub
Re: Easy way to ask for file and directory paths?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
In mycommands.vb you create an instance of your form - something like this:
Friend Shared myForm As New form1
Now mycommands can reference the contents of form1 through the instance "myForm", as in myForm.textbox (or whatever form tools you need to access).
If you want the form1 tools to run methods in mycommands, the sub routines need to be declared as Public Shared.
form1.vb can have something like this:
Private Sub somebutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlescmbFiles.Click
mycommands.processformbuttonclick()
EndSub
mycommands should have Public Shared Sub processformbuttonclick()
This is a good example - it refers to palettes and containers but containers behaviour is very similar to forms.
http://forums.autodesk.com/autodesk/attachments/au
Re: Easy way to ask for file and directory paths?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
thanks.
There is some interesting stuff in the paper by
Mike Tuersley AU2007 that I need to go through
thanks again
