Creator Posted August 15, 2003 Posted August 15, 2003 Hi, I am moving from VB6 to vb.net... In vb6 I can reference to Ms Common Diag box and use it to pop up directory and folder... How do I do it with Vb.net....When i try to reference the com I could not find Ms Common Diag.... pls help! apprec Quote
*Experts* Volte Posted August 15, 2003 *Experts* Posted August 15, 2003 Just use the OpenFileDialog, ColorDialog, and whatnot. There is no need to use the the COM component. Quote
BryanZM Posted August 15, 2003 Posted August 15, 2003 just drop the component on your form and look at the code it generates behind, pretty easy from there. Quote
*Experts* mutant Posted August 15, 2003 *Experts* Posted August 15, 2003 Dim opendialog As New OpenFileDialog() 'declare a new open file dialog 'now set some options.. opendialog.Filter = "Text Files (*.txt)|*.txt" 'example of a filter opendialog.CheckFileExists = True '.. there is more options, check your SDK documentation If opendialog.ShowDialog() = DialogResult.OK Then 'if user pressed ok 'do what you want because the user selected the file you can get it using: opendialog.FileName End If Remeber to check for DialogResult on all your dialog boxes. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.