winform to GTK# for Mono - c#

I have created a C# application with 50 forms.
Unfortunately Mono (Mac OS version) doesn't work with standard window winform.
I don't know why, but I this moment I need to solve the problem.
The only solution seem convert winform to GTK#, but I don't have any experience on GTK#.
My questions are:
How hard is convert my 50 forms to GTK# ?
What I need to do exactly ?
This is an easy solution ? Or I need to re-write my application ?
Apart this I don't know where I can found/use an Visual IDE to do a design modification like Visual Studio IDE.

GTK is a pretty good framework, on both windows and linux, GTK# is very easy to write by hand or to design using monodevelop. So it is worth a shot if you are curious, GTK# apps are generally easier to find help for ( the GTK+ docs are helpful )
The nicest thing about GTK# is the automatic layouts, no more crazy panel placement or absolute positioning like in winforms.
I am curious though why your winforms app isn't working, Mono's winforms support is pretty good and very near exactly matching .Net. What errors do you have?

The issue I had with Winforms at Mono was that in the files "xyz.designer.cs" there is often a code:
((System.ComponentModel.ISupportInitialize)(xyz)).BeginInit();
and
((System.ComponentModel.ISupportInitialize)(xyz)).EndInit();
looks like Mono does not accept this code.
My impression is that this code could be deleted from most of the windows forms. But I am not really sure.
For sure the "xyz.designer.cs" file cannot be modified under Visual studio since this code is automatically created by the GUI designer.
But you could modify these files under Monodevelop.
Looks like you would need to manually update 50 files.

Related

winforms visual styles on mono

How to enable winforms visual styles in mono( probably running in fedora or ubuntu gnome) or is it a good idea to just use GTK#? The thing is I dont want to leave visual studio and use monodevelop for this. Thanks...
Winforms visual styles are more or less emulated in Mono but the appearance is not exactly the same as on Windows. It will work, tho.
I suggest you use GTK# if you plan running on linux indeed.

IDE Support for WinForms

Hey guys I'm a newbie and I just wanted to know of the people who do Winforms on Visual studio, at your place of work do your forms have IDE support. Because for some reason I don't have IDE support on 99% of the windows forms I'm working with. I mean I can not see anything on the design view except for errors is this the usual case in industry????
Are you using any 3rd party UI controls? Some have dll's for the design view to work, and if you haven't installed the toolkit on your developer machine you might get errors like this.
One possible explanation for having errors on forms is licensing. If your company uses third-party controls on their forms, they could cause errors when trying to display the forms on unlicensed machines.
Another possible explanation for errors with third-party controls is simply installation. If you don't have the controls installed and referenced properly, that could also cause errors.
You could try to post some of the errors you have to another Stack Overflow question, and perhaps the community could help you solve your errors.
Sorry, WinForms is not broken for us (me). Check your code. Sometimes WinForms applications that were developed under Visual Sudio 2003 (or earlier) when upgraded to Visual Studio 2005 (or later) become unstable.
Start with a new form, and if the IDE (it is called a visual designer) works fine, then think about re-creating the old forms from scratch with the newest VS installation.
Your question isn't clear!, if the Visual Studio Designer not working well then re-install the IDE
Or explain more...
You should be able to view the forms in the design view.
Always unless there is an error in code. In case the project is building you should get the same error (this is a runtime error) that you will generally get when you run the code.
In case the project is not building it will be simpler to fix the errors :)

Is it possible to create simple programs in C# using VS2010 Express?

I am in the process of learning C#. I downloaded and installed Visual Studio 2010 Express with C#. The problem is it has all these templates that are a little overwhelming at the moment: ASP.NET website, Library, WCF, etc.
I just want to code something very simple that takes input from the Console and outputs to it. I am making do with WCF but that's really inconvenient. It is faster for me to load up ideone.com, type my code there and compile than doing it from own my machine.
Is it even possible to create simple programs like that in C# using VS2010 Express?
Thanks everyone who answered. I installed Visual C# and now I can create console applications. But now the command window closes immediately after it's done doing whatever it's doing. Can I have it output to the IDE like I would with Java on Eclipse or Netbeans?
You can create simple apps by choosing Windows Application (if you want a GUI) or Console Application (if you just want to take input from console as you describe in the question) as project types.
Regarding the question of the console window immediately closing, the quick-and-simple fix for this is to have
Console.ReadLine();
at the end of program execution -- it'll do all it needs to do, then wait for (any) keyboard input before closing the window.
"But now the command window closes immediately after it's done doing whatever it's doing. Can I have it output to the IDE like I would with Java on Eclipse or Netbeans?"
Try running without debug mode (Ctrl+F5 or Shift+F5 or some other binding depending on your keyboard setting). The program will wait for you to press a key to exit.
If you want to output it to the IDE, you could use System.Diagnostics.Trace.Write, which writes to the trace output in the bottom on the IDE. I do not believe there is a built in stdout view in Visual Studio... but it seems like a great idea for a feature...
Are you there, Microsoft?
Visual Studio can be extremely overwhelming. What you should remember is that it's a tool for professionals, ultimately. However, if you want to make a Console app, it's quite simple.
Open Visual Studio
File
New
Project
Other Languages
Visual C#
Windows
Console Application
Done.
Yes, Visual Studio Express is a very good free tool for creating applications. Of course it doesn't have all of the features of Visual Studio, but I use it at home for several reasons.
What you want is the "Console Project" template

Has anyone developed an editor / ide using C#/Silverlight/WPF?

We are currently developing a web application in ASP.NET MVC which would really benefit from a IDE of sometype to help allow some elements to be visually customised.
Could anyone recommend an approach ? We are thinking of maybe a plugin using Silverlight.
Does anyone have any links or examples that might help ?
Well, Visual Studio 2010 is built using WPF - Jason Zander's WebLog
At the PDC and TechEd EMEA last year we described our new editor support built on the WPF technology in .NET Framework 4.0. Today I’m happy to reveal the new UI for Visual Studio, also built on WPF:
Expression Blend is almost entirely written in C#/WPF.
There is also at least one text editor component under development (not sure if it is already available) from a commercial third party, Actipro, which is supposedly going to be available in Silverlight and WPF versions.
From your description of what you need, you seem to be looking more for examples or code for writing a full-blown design surface yourself. I am not aware of a suitable library for that.
There was a company in Canada that made a design surface toolkit for WPF, but I can't recall its name right now. I also believe the component is not available any longer.
There is an opensource C# IDE that was developed using C# - SharpDevelop. I believe this was developed back when .Net 1.x was the new hotness, so I don't believe it uses WPF or Silverlight.
In addition the MonoDevelop IDE is also built in C# and GTK#, originally based on SharpDevelop.

Learn C# on mac?

Is mono the only route , any specific visual studio like editors that you recommend?
Without meaning to state the obvious and miss the point, if you mean a Mac computer rather than a Mac OS, you could install bootcamp or use parallels to run windows on the Mac and then use Visual Studio (there are also free versions of Visual Studio)
Yeah, mono is really your only option, unless some undergrad somewhere has developed some very experimental thing I don't know about. As for an IDE, well I believe the only thing half way stable that will work right now on Mac OS X is Monodevelop:
http://tirania.org/blog/archive/2008/Feb-07-2.html
I mean, you could run Parallels and develop your code on a Windows VM with Visual Studio and as long as you follow certain guidelines about portability, you could use VS to develop your mono apps. Although, you probably might as well get familiar with Monodevelop. It would be interesting to see if SharpDevelop ever gets ported.
Well, you could also try Silverlight...
Pro:
It is an official Microsoft implementation, so it is more likely to work
Its support for recent stuff like C# 3.0 is much better
Con:
It is browser-only, Silverlight apps do not run standalone
You won't get the whole .NET Class Library, only a subset, so it is somewhat limited
You won't get Visual Studio on a Mac
For IDE, I suggest Eclipse Tools for Microsoft Silverlight (apparently it is Windows-only at the moment) you should use MonoDevelop or SharpDevelop or something like that.
Use Xamarin Studio IDE.
https://xamarin.com/mac
Uses Mono and C#. It has any features you might expect from a modern IDE and combines with XCode for GUI.
Mono is pretty much your only route right now, though there are incessant rumours (I wouldn't give much thought to them, though) that Microsoft is planning to port C# to Mac in the future. I'd be very surprised if that happened, though.
As for IDEs, I can't help there... If I want C#, I stick to Visual Studio (run it through Parallels or BootCamp, if you really want to use VS).
Edit: As Graham points out, there is Cocoa#, but I'd caution that simply because the project has stalled, and there's unlikely to be much future for it. :(
I would go the virtualization route, either Parallels or VMware Fusion. Both will run Windows XP and Visual Studio very well on a modern Mac. Windows has the best tools for .NET and C# development and it only makes to use them, especially when you're just starting out.
Virtual Box is my new favorite and open source (means free) VM software. Don't pay for Parallels. Also, with BootCamp, you have to reboot the machine to switch between Windows and OS X, so Virtual Box is the way to go.

Categories