The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
[Originally posted by muni]

My program stop running.When I step through, soon after "OpenFileDialog dlg =
new OpenFileDialog(); " is executed the application dies. Task manger shows
the ¡°helloform12¡± not responding. When stepping through the program I can
see the dialog object is created. I am running on windows 2000 Advanced server
and Visual Studio RTM 1.0. Here is the section of code.
private void OnLodClick(Object Sender, System.EventArgs e)
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "Open Photo";
dlg. Filter =" jpg
files(*.jpg)|*.jpg| All files (*.*)|*.*" ;

if(dlg.ShowDialog() == DialogResult.OK)
pboxPhoto.Image = new Bitmap(dlg.OpenFile());

Is this some thing to do file permission? I have been using Visual studio for
developing console application for last three four months and did not have any
problem. And also ran som windows forms programs without any problem.
import-bot (20211) [Avatar] Offline
Re: Visual Studio - Windows Forms
[Originally posted by fgrimes]

I pasted your code into a Windows Form with a button and a picture box and it
worked fine for me. Exactly at which line does it freeze? Perhaps the error
occurs in the code executed after the dialog has been disposed.


import-bot (20211) [Avatar] Offline
Re: Visual Studio - Windows Forms
[Originally posted by muni]

The program freezes after executing the following line.
OpenFileDialog dlg = new OpenFileDialog();
When the mouse is placed over the form, busy hour glass is displayed and the
task manager shows application is not responding. Is it possible I missed some
thing on install or is it a file permission issue. I tried creating a simple
GUI app and that works ok.