Is it possible to use OpenFileDialog in XNA 4.0 to get the file path? If not, what is the alternative? I'm using XNA 4.0 to create a graphic display (not a game) and I have a file that contains informations on how and what to draw on screen. The only problem is that I hard-coded the path because I don't know how to dynamically get that path? Do you know a solution for that?
Answer
Just put the Attribute [STAThread] above the Main method in the class Program and add the System.Windows.Forms in the References of the project.
After that you'll be able to instantiate and invoke the dialog boxes.
No comments:
Post a Comment