Geeks With Blogs
The Lanham Factor The (ir)rational thoughts of a (not-so)mad man

So I'm doing some independent consulting that turns into contract development.  I have a day job but I figure heck, it's a small WinForms application.  It is, basically, a Wizard-style UI.  The "main" form is the biggest challenge.  It must display HTML with MathML and allow the user to draw on it (straight, rectangle, etc.).  Being the diligent software developer I am, I hired a great team and set about, first, to address the high risk items.  Mind you that in retrospect the highest risk item seems obvious. 


We produced proofs of concept for rendering HTML, downloading images from the Web, displaying graphics (like a ruler) over the form, showing the form in a "kiosk" mode, etc. etc.  We were pleased with our approach and the progress made.  Then integration-time arrived.  We start integrating components and were having much success.  Pride goeth before the fall indeed.  To be perfectly fair, we were not proud...far from it.  We had done a good job and were pleased with the progress.  The code was designed and implemented such that integration was a snap.  The modularity and "loose coupling / high cohesion" made it easy to apply changes in flow and logic.  All-in-all, the application was (and is) well-structured and well-suited for extensibility and growth.

Kobayashi Maru....(for those of you unfamiliar -

It turns out (in no particular order):

  • Microsoft Internet Explorer 7 (and 6 apparently) does not display MathML.  This was not directly/explicitly our problem.  Our client discovered this while writing the Web-based back-office system.  Firefox seems to render MathML just fine.  (PLEASE let me know if you have a solution to IE rendering MathML).
  • The WinForms Web browser control is, essentially, IE-Lite.  This is not news.  What is news to me is that the control relies on MSHTML.  In effect, this makes the Web browser control some sort of bizarre hybrid COM/WinForms control.  As it turns out (and I think it's because of this), GDI+ no likey the Web browser control as a drawing surface. (PLEASE let me know if you have more information / can explain this to me in detail.  I simply haven't had a chance to dig into it more deeply.)

So the only Web browser control for WinForms won't display MathML.  Not that it matters because we can't draw on it anyway.

Beware Greeks....and their tragedies...

So...let's convert the HTML to an image or to RTF and render in an appropriate control. 

  • The RichTextBox control does not have an auto-size property.  (I think we can rely on the ContentResized event). 

I think that's enough for now.  I am somehow certain that I will blog on this again.

If you have any input, any ideas, any suggestions at all, please do not hesitate to reply.  We are moving forward with a different long-term solution BUT I would love to know how others are dealing with these issues.

Posted on Wednesday, January 31, 2007 10:03 PM Cutting Code | Back to top

Comments on this post: Kobayashi Maru - WinForms Style

# re: Kobayashi Maru - WinForms Style
Requesting Gravatar...
We have been giving away our MathPlayer plugin to display MathML in IE for years. We just releases version 2.1 in fact. It even speaks the math and works with screen readers used by the blind to read web pages. See We also have information on how to serve up content containing MathML for maximum browser compatibility.

Paul Topping
Design Science, Inc.
Left by Paul Topping on Feb 01, 2007 7:20 PM

# re: Kobayashi Maru - WinForms Style
Requesting Gravatar...

Thanks for the info. Interestingly enough, Design4Science is the MathML renderer that our client decided to use. And also for the record, it is absolutely one of the best MathML components available. I am very impressed with it!

Left by codesailor on Feb 02, 2007 7:36 AM

Your comment:
 (will show your gravatar)

Copyright © Brian Lanham | Powered by: