You can use a Stack to check if a programming statement or a formula
has balanced parentheses. Write a Windows application that provides a
text box for the user to enter an expression with parenthesis. Provide a
Check Parens button that, when clicked, runs a program that checks the
number of parentheses in the expression and highlights a parenthesis that
is unbalanced.
VulpesPosted Mar 5, 2013, 3:39 PM
The output should be:
I leave it to you to incorporate the logic into a windows forms application.
If you need to highlight something, then you'll need to use a RichTextBox rather than an ordinary TextBox for the user to enter an expression.