Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 6th, 2003, 01:13 AM
iamtgo3 iamtgo3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: USA
Posts: 312 iamtgo3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 27 m 43 sec
Reputation Power: 7
Send a message via ICQ to iamtgo3 Send a message via AIM to iamtgo3 Send a message via MSN to iamtgo3 Send a message via Yahoo to iamtgo3
OpenFileDialog in VS.NET (VB)

Ok in VB6 you could find the file name by using this.

PHP Code:
 stFileName dlgBox.FileTitle 


But in VB.NET on the OpenFileDialog I do not see the .FileTitle anymore. Do you have to manipulate the string or am I missing something?

The .Title gives you the dialog box title not the title of the file itself. old VB6 was .FileTitle but .NET does not seem to have an equivilant value for this. I guess you could manipulate the string returned by .File cuase it returns the path and file name but it would be great if you could just get the filename.
__________________
George - www.ipdg3.com
Helping Developers and Programmers Find Resources
Forums - Contests - Tutorials - Source Code
ORB - Wireless Site - Online Gear

Reply With Quote
  #2  
Old July 6th, 2003, 01:53 AM
iamtgo3 iamtgo3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: USA
Posts: 312 iamtgo3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 27 m 43 sec
Reputation Power: 7
Send a message via ICQ to iamtgo3 Send a message via AIM to iamtgo3 Send a message via MSN to iamtgo3 Send a message via Yahoo to iamtgo3
Well I found the solution on www.gotdotnet.com. Thought if I posted it here other may be able to use it as well.

PHP Code:
 Dim stFileName As String

Dim openFileDialog1 
As New OpenFileDialog

openFileDialog1
.InitialDirectory System.Environment.CurrentDirectory
openFileDialog1
.Title "Open Text File"
openFileDialog1.Filter "Text files (*.txt)|*.txt"
openFileDialog1.FilterIndex 1
openFileDialog1
.RestoreDirectory True

If openFileDialog1.ShowDialog() = DialogResult.OK Then
    Dim stFilePathAndName 
As String openFileDialog1.FileName
    Dim MyFile 
As FileInfo = New FileInfo(stFilePathAndName)
    
stFileName MyFile.Name
End 
If

MessageBox.Show("Your File Info: " vbCrLf vbCrLf _
    
"File Path and Name: " stFilePathAndName vbCrLf vbCrLf _
    
"File Name: " stFileName_
    
"File Info"_
    MessageBoxButtons
.OK_
    MessageBoxIcon
.Information

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > OpenFileDialog in VS.NET (VB)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway