Accessing the message loop

Jun 21 2004 9:39 PM
How does one access the Windows Message Loop in a C# window.forms application? I have a graphics display application in which I would like to "step" through the graphical display (it is a binary tree visualiser and I would like to step through the tree as it is being drawn - node by node!) using a mouse click in the form. Something like this: Paint method { .... DisplayBinaryTree(rootnode); .... } DisplaBinaryTree { DrawNode(current); Wait until mouse is clicked DisplayBinaryTree(current.Left) DisplayBinaryTree(current.Right) } Can anyone tell me how to implement the line "Wait until mouse is clicked"? I assume that I have to get the mouse_clicked message off the message loop somehow, but I can't see any provision for that in C#.

Answers (1)