Noob question

D

Dan McCollick

Hi All,
Noob question that I can not seem to figure out:

I am trying to implement a screenscraper to pull data from two seperate
websites, here is some test code so far:

public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm mainForm = new MainForm();
//Application.Run(new MainForm());
Application.Run (mainForm);
mainForm.setStatusBarLabel("Ready");
//load prosight data
mainForm.loadProsightData();
Application.Run (mainForm);

}

Why, when debuging, does the system never go past Appplication.Run
(mainForm)?

In another method in the mainForm constructor, I load an
InternetExplorer object. I would like the statustext, and progress bar
from this object to feed and update a status bar in my mainform. If
Application.Run(mainform) would end, i could then use the
setStatusBarLabel function to update my status text.....
 
K

Kevin Spencer

Why, when debuging, does the system never go past Appplication.Run
(mainForm)?

Because you told the app to run the form. The form is running. When the form
closes, the method will continue.

Put your form-specific code in the form.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

Dan McCollick said:
Hi All,
Noob question that I can not seem to figure out:

I am trying to implement a screenscraper to pull data from two seperate
websites, here is some test code so far:

public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm mainForm = new MainForm();
//Application.Run(new MainForm());
Application.Run (mainForm);
mainForm.setStatusBarLabel("Ready");
//load prosight data
mainForm.loadProsightData();
Application.Run (mainForm);

}

Why, when debuging, does the system never go past Appplication.Run
(mainForm)?

In another method in the mainForm constructor, I load an
InternetExplorer object. I would like the statustext, and progress bar
from this object to feed and update a status bar in my mainform. If
Application.Run(mainform) would end, i could then use the
setStatusBarLabel function to update my status text.....
 
D

Dan McCollick

Thanks Kevin, I think I certify for your Professional Numbskull title;

I called the Application.run, from the form. I will move this out into
it's own file.

Dan

Kevin said:
Why, when debuging, does the system never go past Appplication.Run
(mainForm)?

Because you told the app to run the form. The form is running. When the form
closes, the method will continue.

Put your form-specific code in the form.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

Dan McCollick said:
Hi All,
Noob question that I can not seem to figure out:

I am trying to implement a screenscraper to pull data from two seperate
websites, here is some test code so far:

public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm mainForm = new MainForm();
//Application.Run(new MainForm());
Application.Run (mainForm);
mainForm.setStatusBarLabel("Ready");
//load prosight data
mainForm.loadProsightData();
Application.Run (mainForm);

}

Why, when debuging, does the system never go past Appplication.Run
(mainForm)?

In another method in the mainForm constructor, I load an
InternetExplorer object. I would like the statustext, and progress bar
from this object to feed and update a status bar in my mainform. If
Application.Run(mainform) would end, i could then use the
setStatusBarLabel function to update my status text.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top