|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Returning the button pressed from a FolderBrowserDialogI have the following code in a VB.NET Windows application and was wondering if there is any way to determine whether or not the user pressed the "Cancel" button on the FolderBrowerseDialog? Me.FolderBrowserDialog1.ShowDialog() I tried dimensioning "x" as a boolean variable and using the statement below, but it returned "true" regardless of what button was pressed. Any ideas? x = Me.FolderBrowserDialog1.ShowDialog() Thanks in advance! *** Sent via Developersdex http://www.developersdex.com *** Ummmmmmmmm ...
If Me.FolderBrowserDialog1.ShowDialog() = DialogResult.Cancel Then ... End If "OutdoorGuy" <Outdoor***@fishing.com> wrote in message I have the following code in a VB.NET Windows application and wasnews:%23RuC1tGJHHA.4712@TK2MSFTNGP04.phx.gbl... Greetings, wondering if there is any way to determine whether or not the user pressed the "Cancel" button on the FolderBrowerseDialog? Me.FolderBrowserDialog1.ShowDialog() I tried dimensioning "x" as a boolean variable and using the statement below, but it returned "true" regardless of what button was pressed. Any ideas? x = Me.FolderBrowserDialog1.ShowDialog() Thanks in advance! *** Sent via Developersdex http://www.developersdex.com *** If FolderBrowserDialog1.ShowDialog() = 2 Then
Debug.WriteLine("canceled") Else ' -- Whatever End If "OutdoorGuy" <Outdoor***@fishing.com> wrote in message news:%23RuC1tGJHHA.4712@TK2MSFTNGP04.phx.gbl... I have the following code in a VB.NET Windows application and wasGreetings, wondering if there is any way to determine whether or not the user pressed the "Cancel" button on the FolderBrowerseDialog? Me.FolderBrowserDialog1.ShowDialog() I tried dimensioning "x" as a boolean variable and using the statement below, but it returned "true" regardless of what button was pressed. Any ideas? x = Me.FolderBrowserDialog1.ShowDialog() Thanks in advance! *** Sent via Developersdex http://www.developersdex.com *** "OutdoorGuy" <Outdoor***@fishing.com> schrieb: \\\> I have the following code in a VB.NET Windows application and was > wondering if there is any way to determine whether or not the user > pressed the "Cancel" button on the FolderBrowerseDialog? > > Me.FolderBrowserDialog1.ShowDialog() Imports WinForms = System.Windows.Forms .... If _ Me.FolderBrowserDialog1.ShowDialog() = _ WinForms.DialogResult.Cancel _ Then ... End If /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> |
|||||||||||||||||||||||