Click here to Skip to main content
15,905,508 members
Home / Discussions / C#
   

C#

 
AnswerRe: Code & Compiler Efficiency Pin
leppie24-Nov-05 20:16
leppie24-Nov-05 20:16 
QuestionHashTable Beginning Question Pin
budidharma24-Nov-05 7:27
budidharma24-Nov-05 7:27 
AnswerRe: HashTable Beginning Question Pin
budidharma24-Nov-05 7:40
budidharma24-Nov-05 7:40 
GeneralRe: HashTable Beginning Question Pin
budidharma24-Nov-05 7:45
budidharma24-Nov-05 7:45 
Questionaccess controls in form1 from form2 Pin
Sam 200624-Nov-05 6:52
Sam 200624-Nov-05 6:52 
AnswerRe: access controls in form1 from form2 Pin
Robert Rohde24-Nov-05 7:08
Robert Rohde24-Nov-05 7:08 
GeneralRe: access controls in form1 from form2 Pin
Sam 200624-Nov-05 7:34
Sam 200624-Nov-05 7:34 
AnswerRe: access controls in form1 from form2 Pin
Curtis Schlak.24-Nov-05 14:16
Curtis Schlak.24-Nov-05 14:16 
I would like to provide an alternate point of view, if you don't mind. You don't have to call the method from messagefom. The ShowDialog method blocks the main thread until it returns. If you need to call the same function every time, then you could do something like this:
namespace.sendmessageform messageform = new namespace.sendmessageform();
messageform.ShowDialog();
this.callTheFunctionYouNeedToCall();
If you have more than one function that can get called, you could define a property in your sedmessageform that your main form can access to decide what to do next. For example,
namespace.sendmessageform messageform = new namespace.sendmessageform();
messageform.ShowDialog();
switch( messageform.SomeProperty )
{
  case SomeEnum.Case1:
    // Do something here.
    break;
  case SomeEnum.Case2:
    // Do something here.
    break;
}
This design is more loosely coupled and does not require that your sendmessageform know about your main form. That would allow for better code re-use if you would like to use your sendmessageform again in another application or in another place in the same application.

I hope that helps you in some way.

"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
GeneralRe: access controls in form1 from form2 Pin
Sam 200624-Nov-05 17:36
Sam 200624-Nov-05 17:36 
QuestionReflection, Breakpoints and Debug Mode Assembllies Pin
Tristan Rhodes24-Nov-05 5:58
Tristan Rhodes24-Nov-05 5:58 
AnswerRe: Reflection, Breakpoints and Debug Mode Assembllies Pin
leppie24-Nov-05 11:00
leppie24-Nov-05 11:00 
QuestionProblem with events Pin
sciamachy24-Nov-05 5:48
sciamachy24-Nov-05 5:48 
AnswerRe: Problem with events Pin
Leslie Sanford24-Nov-05 6:58
Leslie Sanford24-Nov-05 6:58 
QuestionTreeView question. Pin
zaboboa24-Nov-05 4:26
zaboboa24-Nov-05 4:26 
AnswerRe: TreeView question. Pin
Robert Rohde24-Nov-05 4:39
Robert Rohde24-Nov-05 4:39 
QuestionMethod parameters Pin
1nsp1r3d24-Nov-05 3:15
1nsp1r3d24-Nov-05 3:15 
AnswerRe: Method parameters Pin
Leslie Sanford24-Nov-05 3:40
Leslie Sanford24-Nov-05 3:40 
GeneralRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 4:15
Colin Angus Mackay24-Nov-05 4:15 
AnswerRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 4:25
Colin Angus Mackay24-Nov-05 4:25 
GeneralRe: Method parameters Pin
Leslie Sanford24-Nov-05 4:46
Leslie Sanford24-Nov-05 4:46 
GeneralRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 4:58
Colin Angus Mackay24-Nov-05 4:58 
GeneralRe: Method parameters Pin
Leslie Sanford24-Nov-05 5:34
Leslie Sanford24-Nov-05 5:34 
GeneralRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 5:44
Colin Angus Mackay24-Nov-05 5:44 
AnswerRe: Method parameters Pin
Colin Angus Mackay24-Nov-05 5:02
Colin Angus Mackay24-Nov-05 5:02 
QuestionData types in reports (rdls) Pin
doph24-Nov-05 1:50
doph24-Nov-05 1:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.