views:

70

answers:

1

Let's consider this scenario: a freshly create windows form application in which i created a Form2 besides the original Form1.

1st Question: I want both forms to show up at start-up, so i basically wanted to add Application.Run(new Form2()); in main right after the similar command for Form1, but since i read that i cant use multiple threads to run both forms, how do i do it?

2nd Question: How do i access the form methods from an outside class or even main, since even if i create a form instance i cant seem to access them directly.

3rd Question: I need to display a buffer of messages in a form, typically i would use a simple text box, but the problem is that i need to add something like a mark as read to all individual messages... any clues on how to do that?

+2  A: 

1: Check out the ApplicationContext class.

2: The methods need to be public but be careful here because you will start having issues with tight coupling. For a simple implementation, you'll need to pass references to the calling objects (consider researching the Observer pattern).

3: Check out a DataGridView.

Austin Salonen