| | |
Help Web Browser Open File Dialog Problems
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
Hello I'm new here and im a bit confused about a certain code i am trying to do.
The code is for opening the file dialog and when the object has been selected it would be shown in the web browser or open any file, the code i have done opens the file dialog box, but as too is this well the web browser starts to navigate thinking it can find the file but it always does not. Can anyone help with this problem i am having please ?.I am also unsure about how you can make custom settings and how they can work, the reason i want to know this is because i have made a transparency slider and also has a form colour changer, I just do not know how to get these prefrences set for the user so when he/she opens the form up it will be how they selected it.
Here is the code for the open file dialog problem i am having
The code is for opening the file dialog and when the object has been selected it would be shown in the web browser or open any file, the code i have done opens the file dialog box, but as too is this well the web browser starts to navigate thinking it can find the file but it always does not. Can anyone help with this problem i am having please ?.I am also unsure about how you can make custom settings and how they can work, the reason i want to know this is because i have made a transparency slider and also has a form colour changer, I just do not know how to get these prefrences set for the user so when he/she opens the form up it will be how they selected it.
Here is the code for the open file dialog problem i am having
VB.NET Syntax (Toggle Plain Text)
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click WebBrowser1.Navigate(OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK) End Sub
The code won't open a file since it never gets any file name. Try it this way:
now it may or may not open and show the file in the control. If you try to open exe or similar file, you'll get IE's "Run/Save/Cancel" -dialog.
What custom settings? Please, be more specific.
VB.NET Syntax (Toggle Plain Text)
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then WebBrowser1.Navigate(OpenFileDialog1.FileName) End If End Sub
What custom settings? Please, be more specific.
Teme64 @ Windows Developer Blog
•
•
•
•
The code won't open a file since it never gets any file name. Try it this way:
now it may or may not open and show the file in the control. If you try to open exe or similar file, you'll get IE's "Run/Save/Cancel" -dialog.VB.NET Syntax (Toggle Plain Text)
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then WebBrowser1.Navigate(OpenFileDialog1.FileName) End If End Sub
What custom settings? Please, be more specific.
One way is to store the value in application settings. From Project-menu select "<proj name> Properties" and Settings-tab. Add a new setting: SliderOpacity which type is Integer. You may also give it an initial value 15.
In your code you set and save the setting:
and read the setting:
In your code you set and save the setting:
VB.NET Syntax (Toggle Plain Text)
My.Settings.Item("SliderOpacity") = 15 My.Settings.Save()
VB.NET Syntax (Toggle Plain Text)
Dim Opacity As Integer Opacity = CInt(My.Settings.Item("SliderOpacity"))
Teme64 @ Windows Developer Blog
•
•
•
•
One way is to store the value in application settings. From Project-menu select "<proj name> Properties" and Settings-tab. Add a new setting: SliderOpacity which type is Integer. You may also give it an initial value 15.
In your code you set and save the setting:
and read the setting:VB.NET Syntax (Toggle Plain Text)
My.Settings.Item("SliderOpacity") = 15 My.Settings.Save()
VB.NET Syntax (Toggle Plain Text)
Dim Opacity As Integer Opacity = CInt(My.Settings.Item("SliderOpacity"))
Last edited by Lumnous; Nov 3rd, 2008 at 10:00 am. Reason: Forgot to say thankyou
![]() |
Similar Threads
- SpeedUp Your Window XP Never Than Before (Windows tips 'n' tweaks)
- Tutorial: The 10 Minute Linux Firewall (Getting Started and Choosing a Distro)
- Explorer.exe keeps restarting itself (Viruses, Spyware and other Nasties)
- Please help, dieing (Viruses, Spyware and other Nasties)
- MSN and Hotmail Login Problems (Web Browsers)
- Ie Favorites replaced with C:/ WINDOWS folder (Viruses, Spyware and other Nasties)
- HijackThis error? (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: data adapter update method won't work
- Next Thread: VB code.
| Thread Tools | Search this Thread |
.net .net2005 .net2008 30minutes 2005 2008 access account arithmetic array basic browser button buttons center check code component connectionstring crystalreport cuesent data database databasesearch datagrid datagridview date datetimepicker design dissertation dissertations dissertationthesis dissertationtopic dropdownlist excel fade file-dialog filter folder ftp generatetags hardcopy image images input insert intel math monitor net networking opacity output panel passingparameters peertopeervideostreaming picturebox picturebox1 port printing problem problemwithinstallation project reports" savedialog searchvb.net select serial settings shutdown string survey tcp temperature text textbox timer timespan toolbox transparency trim updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





