Accessing the message loop
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#.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Andrzej WegierskiRank #1,729 · 877 reputationPosted Jun 25, 2004, 5:03 AM EDT