I have made a textbox on the form in which user enters any mathematical expression like of fraction,square root, integration etc.......
Now I want that if user enters "square root of 2" then in the listbox it should be displayed in math format .
Or if user enters (2/3), then it should be displayed properly in fraction format like we see in books..........

How can I generate the math format for various mathematical expressions like fractions, squareroots, cube roots,integration, differentiation etc.............

Recommended Answers

All 7 Replies

Hi VibhorG, welcome to DANIWEB!

If you occasionally want to draw a math formula you can use the Paint or OnPaint of the form for instance to draw whatever you want.
Else, it is perhaps better to use a tool for it. This site uses TeX to do such things, when you want to post a formula.

no idea....but if u find the solution then hit me back..

Thank you "ddanbe"
Well can you tell me how can i use Tex for "C# window application".......
Kindly help me with respect of this.........

I'm affraid that is way beyond my knowledge, sorry.
Perhaps this may shed a light of the complexity : http://www.ctan.org/tex-archive/help/Catalogue/bytopic.html

I also know that in Word you can insert an Equation editor object, but I don't know if it can be accessed by C#.

parse the entered string to first find mathematical symbols: '*, ^, +, -, etc,' then have the string parsed for characters that can be translated into math functions; 'square root of 2.' A simple way to display the expression would be to use textboxes and GDI+.. For example, you could put a small textbox ontop of another and use GDI+ to draw a line in between them whenever your parsed strings shows up as 'division.' Let us know what you find out :P

@CodemasterA, welcome here and thanks for the very good hint. :)
Don't forget to read the member rules.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.