Hi there,
I am currently trying to learn Visual Basic, using Visual Basic Express 2005. I am making a Mulitmedia Player. I have added Windows Media Player via the COM components and dragged it onto the stage, and I have also created a browse... button with the following code: - Private Sub BtnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBrowse.Click
-
With OpenFileDialog1
-
.Title = "Media File Browser"
-
.Filter = "Media Files (*.wmv;*.mp3)|*.wmv;*.mp3"
-
.FileName = ""
-
.CheckFileExists = True
-
End With
-
-
If OpenFileDialog1.ShowDialog = _
-
Windows.Forms.DialogResult.OK Then
-
AxWindowsMediaPlayer1.URL = _
-
OpenFileDialog1.Filename
-
End If
-
End Sub
-
End Class
But the OpenFileDialog1 is underlined in blue, and VBexpress says there is an error.
Any help would be helpful, thanks
Luke
7 5054
... and VBexpress says there is an error.
Here's a tip. Any time you report an error, be specific. Tell us what error.
My guess is, in this case, you simply don't have any object called OpenFileDialog1 . However, I'm only familiar with VB6 and things may work differently in your version.
OK, thanks for the tip. The error message is that the "build fails", because of the following:
1. Name 'OpenFileDialog 1' is not declared. Line 9, Column 14.
2. Name 'OpenFileDialog 1' is not declared. Line 16, Column 12.
3. Name 'OpenFileDialog 1' is not declared. Line 19, Column 13.
Hopefully that is of some help.
Luke
SammyB 807
Recognized Expert Contributor
You need to drag an OpenFileDialog from the Toolbox and drop it onto your project. It will go into the tray under your form and OpenFileDialog1 will be defined. Hope your enjoy learning VB. It's tough, but worth the trouble. --Sam
You need to drag an OpenFileDialog from the Toolbox and drop it onto your project. It will go into the tray under your form and OpenFileDialog1 will be defined. Hope your enjoy learning VB. It's tough, but worth the trouble. --Sam
Thanks very much, it works wooo
And i agree VB is hard the more advanced you get, but that is like anythink!
once again thank you
Thanks very much, it works wooo
And i agree VB is hard the more advanced you get, but that is like anythink!
once again thank you
Like many of the best tools, it is fairly quick and simple to get into, but takes a lot more effort to learn really well.
ahhh!!!!!!!!!!! !!!!!!!
I was having the exact same problem and now its solved!!
Thanks!
i was having the exact same problem and now its solved
Glad we could help. :)
That's why all this stuff is archived, of course. So it's available for anyone who comes along with the same problem.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: violin wang |
last post by:
hi
I wrote a windows based program.The main UI named
form_base has a button "btn1".In btn1`s click event
handler I used ShowDialog(this) to show another form
named form_test.form_test also has a button btn2 and I
added a openfiledialog in form_test.In btn2 click event
handler I used ShowDialog(this) to show openfiledialog.
When I ran the...
|
by: Bonzo |
last post by:
Hi,
How do I simply open a text file into a textbox? I know that in C++ I'd use
something like:
if(OpenDialog1->Execute())
Memo1->Lines->LoadFromFile(OpenDialog1->FileName);
How can I do it in vsnet c#?
THX
|
by: don |
last post by:
has anyone experienced problems with interactions between OpenFileDialog and FileStream? When I select "open" from an OpenFileDialog the subsequent calls to FileStream do not create a file. If I do anything else, eg, navigate to other folders, and then press "cancel" the file is created. This occurrs just with the simple code below. Any ideas...
|
by: e-mid |
last post by:
why does not openFileDialog have closed event?
i want to do something; as soon as the dialog closes. is there a way to do
this?
|
by: Austin Jan |
last post by:
Hi all,
In this code snip
try
{
using(OpenFileDialog dlg = new OpenFileDialog())
{
//do something
}
| |
by: Burt |
last post by:
I am new to VC++ and .NET, so this is a pretty basic question...
I want to use OpenFileDialog. Where is the header for it?
And in general, how do I find the right header to include in cases like this
within .NET? I would thought that
#include <OpenFileDialog.h>
would do the trick, but there ain't no such beast apparently.
|
by: Willem |
last post by:
Hi,
I am creating a web application in asp.net in which I have to show an
openfiledialog box to select the file and display the selected file with its
path in a text box.
I try to solve this problem with the System.Windows.Forms.OpenFileFialog.
I use
Imports System.Windows.Forms
|
by: marcus.kwok |
last post by:
I am having a weird problem and I have can't figure out why it is
happening. I create an OpenFileDialog and set a filename filter. When
the dialog first opens, the filter works correctly, and only the files
I want to see appear in the file list box. When I change the filter to
one of the other filters, all the files in the list disappear. ...
|
by: Gregaz |
last post by:
I have a form in my project, which I open as a DialogBox. On that that
form there are 3 TextBoxes. To one of them I want to write in a file
path. To have it easier I have an OpenFileDialog control on my form.
Selected file path is written in to th TextBox. OpenFileDialog is open
by click on a Button.
There is other Button on the form run...
|
by: Martijn Mulder |
last post by:
It strikes me that System.Windows.Forms.OpenFileDialog seems te
'remember' which directory it was in last, even when a new
OpenFileDialog-object is created for every access to the file system.
This 'persistence' also holds between different invocations of the same
program. Even when the .cs file is re-compiled, the OpenFileDialog again
opens...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |