|
Hi. Does anyone know what I should use to show complex math formulas? I was thinking RichTextBox but I haven't been able to figure it out yet...
Example : http://home.student.uu.se/s/stli3909/untitled.bmp
which in VB would be equal to (1+2+3)/Sqr((1+2)/3)
I tried formatting the individual fonts and found the
square root sign but unfortunately it only consisted of the initial "checkmark" and not the horizontal line above what it's supposed to cover.
I would be extremely grateful for any help, because it would make the app I'm working on so much more attractive.
|
|
|
A rich textbox is not going to help you. The square root sign uses space to the left and above the elements under it -- that just isn't how HTML text and images flow naturally. BUT, here are 2 ideas.
One, create an image that is just the square root sign with a white background (or whatever background color you want - you could also try a transparent background). Then you'd have to get clever and use CSS positioning to force your symbol to appear where you want it, and to appear behind the numbers so you can still see them. Check out the positioning attributes on this Microsoft CSS Attributes reference page: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference/attributes.asp?frame=true
Another idea -- again, not a simple solution -- is to actually draw the symbol dynamically using DHTML/JavaScript graphic rendering functions like the amazing code from walterzorn.com: http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
Basically, you would display your numbers and underlines like you would normally, then you'd draw the symbol and tell the functions exactly WHERE to display the resulting line art.
The real trick in both of these solutions is the positioning--which is why I think I'd try the first solution first. Please let us know how it goes.
Message to all forum posters: PLEASE remember to take the time to come back to the thread and post your final solution and/or comments. It's that followup and feedback that keeps the forums alive and keeps the "experts" providing answers.
|
|
|
|
|
Sorry, I forgot that I also need to copy the final answer with same layout so that the suer can paste it into Word for example. Would the above still work?
|
|
|
I'm not sure if a standard copy & paste of HTML that includes absolute positioned elements would retain 100% of it's positioning and formatting when pasted into Word. Try it -- that's what I'd have to do to find out, so you might as well do it since it's your project.
Of course an actual screen-shot would always work. (Alt-Printscreen will take a screenshot of only the active window. You can then CTRL-V to paste the screenshot into Word, email, Paint, etc.)
|
|
|
|
|
StefanL, don't forget to follow up to let us know how things worked out for your project. That's the purpose of the forums -- to find answers, and allow others to learn from our journey.
Thanks for using the codetoad.com forums!
|
|
|
|
|
|
|
|
|
// |