• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 417
  • Last Modified:

Dialog Box - Buffer Overflow Error

I have a VB.NET app in which I am trying to provide the ability to select a directory to which you would like to save data.

The code for this is below:

Me.FolderBrowserDialog1.Description = _
            "Select the directory that you want to use As the default."

        If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
            txtCardLoc.Text = FolderBrowserDialog1.SelectedPath
        End If

When I run the code I get the following error:

An unhandled exception of type 'System.StackOverflowException' occurred in system.windows.forms.dll

Please help.  The microsoft documentation seems to show the same basic method for this functionality.  Is there something else that I am supposed to reference or a component I need to add?
0
BodeTech
Asked:
BodeTech
1 Solution
 
SRigneyCommented:
This can happen when you have a recursive call and doen't know it.

What is the name of the function that this code is in?
0
 
BodeTechAuthor Commented:
You were correct, I had the function happening on "GotFocus" and that was being called over and over and over and over...etc.

Thanks for the help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now