Xentrolis
New member
Hello, my name is Xentrolis and I'm new to this forum, and fairly new to the VB.NET programming language.
My problem is with and Open File Dialog. I've just started learning VB very recently, following tutorials at Microsoft Visual Basic .NET tutorials for Beginners, so the "application" I'm making is a very simple one and doesn't function fully as it is supposed to, however let's get down to business:
I'm trying to test whether the Open button or the Cancel button in an OpenFileDialog was clicked. I want one of two things to happen:
1. If the Cancel button is clicked, I want to display a messagebox saying "Cancel Button Clicked"
-or-
2. If the Open button is clicked, I want to disoplay a messagebox showing the path and file name of the .txt file selected.
I've basically got it working, except for one small querk. When you click File>Open, it opens an OpenFileDialog, as it should, however whether you click Open or Cancel, it will display the messagebox showing what I want it to, however another OpenFileDialog pops up directly after you click either button.
I'm using Microsoft Visual Basic 2010 Express, in case you needed to know.
Any and all help is appreciated, and please try not to flame or troll me just because I'm new to this forum. I'm not new to the internet, and it will not work. If you have nothing helpful or constructive to say, do us both a favor and don't say anything at all.
My problem is with and Open File Dialog. I've just started learning VB very recently, following tutorials at Microsoft Visual Basic .NET tutorials for Beginners, so the "application" I'm making is a very simple one and doesn't function fully as it is supposed to, however let's get down to business:
I'm trying to test whether the Open button or the Cancel button in an OpenFileDialog was clicked. I want one of two things to happen:
1. If the Cancel button is clicked, I want to display a messagebox saying "Cancel Button Clicked"
-or-
2. If the Open button is clicked, I want to disoplay a messagebox showing the path and file name of the .txt file selected.
I've basically got it working, except for one small querk. When you click File>Open, it opens an OpenFileDialog, as it should, however whether you click Open or Cancel, it will display the messagebox showing what I want it to, however another OpenFileDialog pops up directly after you click either button.
I'm using Microsoft Visual Basic 2010 Express, in case you needed to know.
Any and all help is appreciated, and please try not to flame or troll me just because I'm new to this forum. I'm not new to the internet, and it will not work. If you have nothing helpful or constructive to say, do us both a favor and don't say anything at all.