| | |
Help Web Browser Open File Dialog Problems
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
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 .net2008 2005 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel exists fade filter forms ftp generatetags html images input insert intel internet listview mobile module monitor net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown soap socket sqldatbase sqlserver survey temperature textbox timer timespan transparency trim txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





