473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Menu Item

I have a problem loading a file from the Menu item. In fact I just
copied from another program where it works.

Private Sub toolStripMenuItemLoadSession_Click(ByVal sender As
Object, ByVal e As EventArgs) Handles
toolStripMenuItemLoadSession.Click
Try
Dim fi As New FileInfo(Application.ExecutablePath)
openFileDialogDump.InitialDirectory = fi.DirectoryName
openFileDialogDump.AddExtension = True
openFileDialogDump.DefaultExt = "xml"
openFileDialogDump.FileName = "UserSession.xml"
Dim dr As DialogResult = openFileDialogDump.ShowDialog(Me)
If dr = System.Windows.Forms.DialogResult.OK Then

Me.myUser.Predicates.loadSettings(openFileDialogDu mp.FileName)
End If
Catch ex As Exception
Me.richTextBoxOutput.Text += ex.Message &
Environment.NewLine
End Try
End Sub

I get the error that openFileDialogDump does not exist. Any ideas?

K.
Aug 8 '08 #1
2 855
Kronecker

Did you drag an openFileDialog on your surface and give it the name as used
in the code?

Cor

<kr*******@yahoo.co.ukschreef in bericht
news:ec**********************************@b2g2000p rf.googlegroups.com...
>I have a problem loading a file from the Menu item. In fact I just
copied from another program where it works.

Private Sub toolStripMenuItemLoadSession_Click(ByVal sender As
Object, ByVal e As EventArgs) Handles
toolStripMenuItemLoadSession.Click
Try
Dim fi As New FileInfo(Application.ExecutablePath)
openFileDialogDump.InitialDirectory = fi.DirectoryName
openFileDialogDump.AddExtension = True
openFileDialogDump.DefaultExt = "xml"
openFileDialogDump.FileName = "UserSession.xml"
Dim dr As DialogResult = openFileDialogDump.ShowDialog(Me)
If dr = System.Windows.Forms.DialogResult.OK Then

Me.myUser.Predicates.loadSettings(openFileDialogDu mp.FileName)
End If
Catch ex As Exception
Me.richTextBoxOutput.Text += ex.Message &
Environment.NewLine
End Try
End Sub

I get the error that openFileDialogDump does not exist. Any ideas?

K.

Aug 8 '08 #2
On Aug 8, 10:54 am, kronec...@yahoo.co.uk wrote:
I have a problem loading a file from the Menu item. In fact I just
copied from another program where it works.

Private Sub toolStripMenuItemLoadSession_Click(ByVal sender As
Object, ByVal e As EventArgs) Handles
toolStripMenuItemLoadSession.Click
Try
Dim fi As New FileInfo(Application.ExecutablePath)
openFileDialogDump.InitialDirectory = fi.DirectoryName
openFileDialogDump.AddExtension = True
openFileDialogDump.DefaultExt = "xml"
openFileDialogDump.FileName = "UserSession.xml"
Dim dr As DialogResult = openFileDialogDump.ShowDialog(Me)
If dr = System.Windows.Forms.DialogResult.OK Then

Me.myUser.Predicates.loadSettings(openFileDialogDu mp.FileName)
End If
Catch ex As Exception
Me.richTextBoxOutput.Text += ex.Message &
Environment.NewLine
End Try
End Sub

I get the error that openFileDialogDump does not exist. Any ideas?

K.
Make sure you named your OpenFileDialog component as
"openFileDialogDump" in properties window which is dragged-dropped on
your form from toolbox.

Or, instantiate OpenFileDialog class with the name of your variable in
your "try" block as:

Dim openFileDialogDump As New OpenFileDialog

...then use it.
Thanks,

Onur Güzel
Aug 8 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
10
by: tmaster | last post by:
When I try to dynamically add a second sub menu item to this ContextMenu item, I get an error 'Specified argument was out of the range of valid values'. Private Sub mnuTopics_Show_Select(ByVal...
4
by: Bob Homes | last post by:
In VB6, I used a system, which I loved, whereby I assigned a "helpId" to each menu item; that way, you could rest the cursor on the item (without actually running it) and then press F1 to get...
8
by: gs | last post by:
I was able to set tooltips on objects other than main menu. I would like to get the effect of tooltip or microhelp in the bottom status bar when the mouse is hovering over a submenu item. How do...
1
by: Kayvine | last post by:
Hi guys, this is a question I have for an assignment, it is pretty long, but I am not asking for the code(well if someone wants to write I'll be really happy, lol), but I just want to know how to...
1
by: Dave | last post by:
Hello, I'm working on a new site and i'd like to have a navigation menu on it. Ideally i'm thinking: home first item second item etc obviously with different names. I could use echo to...
4
by: stuckagain | last post by:
Hi, I have a page with a scrollable DIV, and within that DIV, I have a few asp.net menu controls. The idea being, the user mouses over the small icons and is presented with a list of options. ...
2
by: dharmbhav | last post by:
Hello all, I am trying to develop a roll-over menu effect on a page. It works fine with all other browsers except IE6. Can some one please help me? HTML: <div class="menu-item-wrap">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.