How to write quadratic equation on Label in C# WinForms?

别说谁变了你拦得住时间么 提交于 2019-12-22 14:58:09

问题


We are making statistical software. Everywhere we need to put formula such as ax2+bx+c How to make ax2 means x square 2. I want to display 2 on upper side of x. Same with πc I want to display c at suffix.


回答1:


Do you have a fixed list of formulas that users can choose but cannot edit? Then generate an image for each formula, store them in your application, and display them in a PictureBox.

If you expect users to be able to type in arbitrary formulas and render them interactively, you will have to implement a visual formula editor control. These controls take markup such as MathML or TeX and render them as graphics. Several are described in the link I provided, but I do not know of any such .Net controls for WinForms.




回答2:


for the "upper" 2 and 3 there are symbols: a², a³ (even on a german keyboard but you will find them in your symboltable in windows too) - the lower c will be harder - I would consider using pictures for those more complex formulas (if you need dynamic formulas it you might have to create them with Graphics in code)



来源:https://stackoverflow.com/questions/9409695/how-to-write-quadratic-equation-on-label-in-c-sharp-winforms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!