简体   繁体   English

将Winform转换为GTK#for Mono

[英]winform to GTK# for Mono

I have created a C# application with 50 forms. 我创建了具有50个表单的C#应用​​程序。

Unfortunately Mono (Mac OS version) doesn't work with standard window winform. 不幸的是,Mono(Mac OS版本)不适用于标准窗口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#. 唯一的解决方案似乎是将winform转换为GTK#,但是我对GTK#没有任何经验。

My questions are: 我的问题是:

  • How hard is convert my 50 forms to GTK# ? 将我的50个表格转换为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. 除此之外,我不知道在哪里可以找到/使用Visual IDE进行像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 . GTK是一个非常好的框架,在Windows和Linux上,GTK#都非常易于手工编写或使用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 ) 因此,如果您好奇的话,值得一试,GTK#应用程序通常更容易找到帮助 (GTK +文档很有帮助)

The nicest thing about GTK# is the automatic layouts, no more crazy panel placement or absolute positioning like in winforms. 关于GTK#的最好的事情是自动布局,不再像在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. 我很好奇为什么您的winforms应用程序无法正常工作,Mono的winforms支持非常好并且非常接近.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: 我在Mono的Winforms遇到的问题是,在文件“ xyz.designer.cs”中通常有一个代码:

((System.ComponentModel.ISupportInitialize)(xyz)).BeginInit();

and

((System.ComponentModel.ISupportInitialize)(xyz)).EndInit();

looks like Mono does not accept this code. 看起来Mono不接受此代码。 My impression is that this code could be deleted from most of the windows forms. 我的印象是可以从大多数Windows窗体中删除此代码。 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. 确保可以在Visual Studio下修改“ xyz.designer.cs”文件,因为该代码是由GUI设计器自动创建的。 But you could modify these files under Monodevelop. 但是您可以在Monodevelop下修改这些文件。 Looks like you would need to manually update 50 files. 看来您需要手动更新50个文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM