1
Answer

Accessing the message loop

p.sinfield

p.sinfield

20y
1.3k
1
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)