Saturday, June 07, 2008

Running .Net Winforms Application in Mono

I am curious to try running .Net Winforms application for several reason :

  • Most portable GUI-based .Net app is written not using Winforms but something else e.g: gtk.
  • Want to see how far the Mono team in dealing with GUI application so far (I have used server application written in .net in mono but no winform application yet).
  • I have written pure and relatively simple/common winform application that supposed to run in any "good enough" winform port. Before it, my use of winforms had to goes into win32 specific "hack" which less likely to run in non-win32 .Net port.
So, here goes the result : it runs quite well. I only copied the binaries compiled by visual studio and the neccessary dll in windows to linux (after changing code for file/directory path to a more neutral convention) and run :

mono quicktask.exe

and the application "magically" run. Screenshot below :

It's the quicktask app from my previous post, so you could compare with the screenshot on that post. There's only some odd pixels in textbox borders but beside that, things are running fine.

Now, as long as you don't use anything strange with winform, it seems to be quite a portable development platform now. Pretty convinient if you would like to stay developing in winform or already have a codebase in it and want port it to platform that can run mono.

One note though, if you have more need like more integrated look and feel you probably want to look other alternative e.g: gtk sharp, since currently winform in mono feels like the early java gui toolkit i.e: it uses it's own rendering instead of using native widgets. It's good enough to make things run but probably won't impress too much consdering how user interfaces is getting shinier these days.

No comments: