GTKSystem.Windows.Forms 1.3.24.72

dotnet add package GTKSystem.Windows.Forms --version 1.3.24.72
                    
NuGet\Install-Package GTKSystem.Windows.Forms -Version 1.3.24.72
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GTKSystem.Windows.Forms" Version="1.3.24.72" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GTKSystem.Windows.Forms" Version="1.3.24.72" />
                    
Directory.Packages.props
<PackageReference Include="GTKSystem.Windows.Forms" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GTKSystem.Windows.Forms --version 1.3.24.72
                    
#r "nuget: GTKSystem.Windows.Forms, 1.3.24.72"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GTKSystem.Windows.Forms@1.3.24.72
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GTKSystem.Windows.Forms&version=1.3.24.72
                    
Install as a Cake Addin
#tool nuget:?package=GTKSystem.Windows.Forms&version=1.3.24.72
                    
Install as a Cake Tool

GTKSystem.Windows.Forms

介绍

Visual Studio原生开发,无需学习,一次编译,跨平台运行. C#桌面应用程序跨平台(windows、linux、macos)开发框架,基于GTK组件开发,使用该框架开发项目,Visual studio可以使用C#的原生winform表单窗体设计器,相同的属性、方法、事件,C#原生开发即可,无需学习。一次编译,跨平台运行。 便于开发跨平台winform软件,便于将C# winform软件升级为跨平台软件。

项目官网:https://www.gtkapp.com

软件架构

使用DotNet Csharp为开发语言,使用GTK3.24.24.95作为表单UI,重写C#的System.Windows.Forms组件,在应用时,兼容原生C#程序组件。

安装教程

默认的情况下,visual studio从Nuget引用GtkSharp编译时,就会自动下载Gtk.zip运行时安装包,并自动解压安装。本开源项目下载包也包含Gtk.zip包,可手动安装。以下是三种环境安装方法:

1、安装GtkSharp后,编译你的工程项目,手动从本项目下载运行时库安装,(Visual Studio开发环境必需)。 安装GtkSharp后,编译你的工程项目时,会自动下载gtk.zip解压到目录$(LOCALAPPDATA)\Gtk\3.24.24配置Gtk环境,目前国内网络限制,可能会出现无法下载的错误。 自动下载的库版本较低,本项目提供下载 https://gitee.com/easywebfactory/GTK-for-Windows/tree/master/Dependencies。 也可以下载https://github.com/GtkSharp/Dependencies(版本比较旧,有bug),把文件解压后放到$(LOCALAPPDATA)\Gtk\3.24.24目录即可。 ps: $(LOCALAPPDATA)为电脑的AppData\Local文件夹,如:C:\Users\chj\AppData\Local\Gtk\3.24.24

2、下载exe安装包安装 本项目提供下载 https://gitee.com/easywebfactory/GTK-for-Windows/tree/master/Dependencies。 获取最新版本安装:下载https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer,安装后配置电脑变量环境:

你可以打开电脑属性配置,或者执行以下.bat命令(自行修改安装目录):
@set GTK3R_PREFIX=C:\Program Files\GTK3-Runtime Win64\bin
@echo set PATH=%GTK3R_PREFIX%;%%PATH%%
@set PATH=%GTK3R_PREFIX%;%PATH%
//在windows下使用环境变量,在有些情况下可能会出现异常,如:与intel wifi的zlib1.dll冲突
//英特尔的环境变量 PATH: C:\Program Files\Intel\WiFi\bin\
//解决方法:修改C:\Program Files\Intel\WiFi\bin\zlib1.dll的名称或删除该文件
//注意:修改该文件可能对intel wifi正常运行的影响

3、使用MSYS软件平台安装,具体操作请网上查询

windows安装DotNet环境:

  从微软官网下载安装包https://dotnet.microsoft.com/zh-cn/download

桌面版linux操作系统通常已经预装GTK环境,不需要再安装GTK,只需安装DotNet SDK即可运行本框架。

对于没有安装GTK环境的linux系统,可用以下命令安装:

#Debian/Ubuntu环境
    sudo apt install libgtk-3-0  //Binary package
    sudo apt install libgtk-3-dev //开发环境 package
#Arch环境
    sudo apt install gtk3
#Fedora	环境
    sudo apt install gtk3    //Binary package
    sudo apt install gtk3-devel  //开发环境 package

*或指定库名安装
    sudo apt-get install libgtk3*

#从MSYS2安装:
    pacman -S mingw-w64-ucrt-x86_64-gtk3 或 pacman -S mingw-w64-x86_64-gtk3

*检查环境情况(需要安装pkg-config):
    pkg-config --cflags --libs gtk+-3.0
*查找gtk的安装包目录:
    ldconfig -p | grep gtk

linux安装DotNet环境:

  安装方法可以查看微软官网教程:https://learn.microsoft.com/zh-cn/dotnet/core/install/linux-scripted-manual

MacOS安装gtk环境

一、应用商店安装:
	brew install gtk+3

二、源码安装	
	# 克隆 Gtk-OSX 仓库(gtk-osx-master.zip解压后可本地安装)
		git clone https://gitlab.gnome.org/GNOME/gtk-osx.git
		cd gtk-osx
	# 运行安装脚本
		/gtk-osx-setup.sh

MacOS安装dotnet环境

安装方法请看微软官方教程:https://learn.microsoft.com/zh-cn/dotnet/core/install/macos

开发教程

  1. 项目工程框架选择“window应用程序”,改配置<UseWindowsForms>为false,.net6及以上版本
  2. NulGet安装GtkSharp(3.24.24.95)、GTKSystem.Windows.Forms、GTKSystem.Windows.FormsDesigner
  3. 检查form表单是否有使用图像资源,如使用需新建System.Resources.ResourceManager和System.ComponentModel.ComponentResourceManager,具体请看下面内容。
  4. 安装本下载包里的【VisualStudio开发插件】,用于添加窗体创建模板。

如何运行软件

  1. windows下:直接编译发布运行,Debug目录的demo_app.exe文件或demo_app.dll文件都可以直接运行。
  2. linux和macos上:执行命令运行dotnet demo_app.dll。

VisualStudio插件安装

工具一、从NuGet上安装GTKSystem.Windows.FormsDesigner类库,此类库可以在编译工程时修正窗体设计器。

工具二、下载本插件工具,关闭visual studio,直接双击GTKWinformVSIXProject.vsix文件安装(本框架下的工程,Studio没有添加Form模板项,需要安装此插件)

插件会安装两个功能:

1、新建项的Form窗体模板、用户控件模板。

2、工程右键菜单。

输入图片说明

开发教程及说明

以下配置在你的项目工程里操作:

1、新建System.Resources.ResourceManager类<br/> 在项目下新建System.Resources.ResourceManager类,继承GTKSystem.Resources.ResourceManager,用于覆盖原生System.Resources.ResourceManager类。 GTKSystem.Resources.ResourceManager实现了项目资源文件和图像文件读取。 如果项目里没有使用资源图像文件,可以不用新建此文件。

2、新建System.ComponentModel.ComponentResourceManager类<br/> 在项目下新建System.ComponentModel.ComponentResourceManager类,继承GTKSystem.ComponentModel.ComponentResourceManager,用于覆盖原生System.ComponentModel.ComponentResourceManager类。<br/> GTKSystem.ComponentModel.ComponentResourceManager实现了项目资源文件和图像文件读取(调用GTKSystem.Resources.ResourceManager)。 如果项目里没有使用资源图像文件,可以不用新建此文件。

3、GTKWinFormsApp.csproj<br/> 配置<UseWindowsForms>为false

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <UseWindowsForms>false</UseWindowsForms>

4、引用GTKSystem.Windows.Forms、System.Resources.Extensions <br/> GTKSystem.Windows.Forms是必须引用<br/> System.Resources.Extensions是空程序dll,不是必须引用,只有VS在窗体设计器出现相关异常提示时使用

5、从NuGet安装GTKSystem.Windows.FormsDesigner,用于开启窗体设计器。<br/> 使用窗体设计器有几种方法,详细的使用教程可以访问https://www.gtkapp.com/formsdesigner

Resources资源的使用

支持GTKSystem,获取技术服务

企业服务:https://www.gtkapp.com/vipservice

交流/合作/商务/赞助

QQ群:1011147488 邮箱:438865652@qq.com <br/>

默认风格效果

demo效果

自定义风格效果

工具栏菜单

支持各种主题风格界面(windows xp、vista、7、8、10,macOS系列,等等)

主题风格,window10黑色风格界面

mwindow10黑色风格界面

常见问题

为什么Form窗体设计器打不开?<br/>

详细方法请访问[https://www.gtkapp.com/formsdesigner/](https://www.gtkapp.com/formsdesigner/)。 

有三种方法使用窗体设计器,
一)新建一个csharp原生Net框架windows应用程序工程,把相关form界面文件包含进工程,即可使用窗体设计器。  
二)新建一个framework框架的windows应用工程,把相关form界面文件包含进工程,即可使用窗体设计器。 
三)从NuGet安装GTKSystem.Windows.FormsDesigner,重新编译工程,如无法打开,重启visual studio,重复前面操作

参与贡献

  1. https://www.gtkapp.com
  2. https://gitee.com/easywebfactory
  3. https://github.com/easywebfactory

更新记录

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on GTKSystem.Windows.Forms:

Package Downloads
Net4x.GtkWindowsFormsLibrary

Windows Library

Net4x.InputBoxLibrary.GtkWinForms

InputBoxLibrary WinForms

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on GTKSystem.Windows.Forms:

Repository Stars
easywebfactory/gtksystem-windows-forms
C # desktop application cross platform (Windows, Linux, macOS) development framework, based on GTK components. Using this framework to develop projects, Visual Studio can use C #'s native Winform form designer. The same properties, methods, and events can be developed in C # without learning. One compilation, cross platform operation.
Version Downloads Last Updated
1.3.24.72 322 7/25/2025
1.3.24.71 433 7/24/2025
1.3.24.70 372 7/21/2025
1.3.24.69 198 6/29/2025
1.3.24.68 182 6/14/2025
1.3.24.67 192 5/26/2025
1.3.24.66 323 5/5/2025
1.3.24.65 152 4/19/2025
1.3.24.64 331 3/10/2025
1.3.24.63 200 3/9/2025
1.3.24.62 330 2/27/2025
1.3.24.61 120 2/26/2025
1.3.24.60 177 2/10/2025
1.3.24.59 142 2/5/2025
1.3.24.58 375 1/2/2025
1.3.24.57 171 12/28/2024
1.3.24.56 188 12/13/2024
1.3.24.55 152 11/26/2024
1.3.24.54 306 11/14/2024
1.3.24.53 164 11/6/2024
1.3.24.52 164 10/24/2024
1.3.24.51 121 10/23/2024
1.3.24.50 161 10/19/2024
1.3.24.49 153 9/27/2024
1.3.24.48 145 9/22/2024
1.3.24.47 233 8/27/2024
1.3.24.46 346 8/26/2024
1.3.24.45 313 7/16/2024
1.3.24.44 135 7/15/2024
1.3.24.43 140 7/12/2024
1.3.24.42 165 7/8/2024
1.3.24.41 218 7/7/2024
1.3.24.40 141 7/2/2024
1.3.24.39 165 6/27/2024
1.3.24.38 181 6/22/2024
1.3.24.37 132 6/22/2024
1.3.24.36 141 6/20/2024
1.3.24.35 135 6/20/2024
1.3.24.34 137 6/18/2024
1.3.24.33 135 6/11/2024
1.3.24.32 131 6/9/2024
1.3.24.31 156 5/30/2024
1.3.24.30 126 5/27/2024
1.3.24.29 133 5/22/2024
1.3.24.28 136 5/21/2024
1.3.24.27 123 5/20/2024
1.3.24.26 140 5/16/2024
1.3.24.25 119 5/16/2024
1.3.24.24 139 5/15/2024
1.3.24.23 146 5/10/2024
1.3.24.22 151 5/6/2024
1.3.24.21 134 5/6/2024
1.3.24.20 126 5/5/2024
1.3.24.14 167 4/20/2024
1.3.24.13 131 4/19/2024
1.3.24.12 154 3/28/2024
1.3.24.11 432 3/19/2024
1.3.24.10 144 3/6/2024
1.3.24.9 187 3/2/2024
1.3.24.8 130 2/29/2024
1.3.24.7 143 2/22/2024
1.3.24.6 177 2/20/2024
1.3.24.5 128 2/18/2024
1.3.24.4 140 2/8/2024
1.3.24.3 138 2/5/2024
1.3.24.2 140 2/5/2024
1.3.24.1 133 2/5/2024
1.0.0.3 138 2/8/2024
1.0.0.2 151 2/8/2024
1.0.0.1 193 2/5/2024

C#界面跨平台开发组件GTKSystem.Windows.Forms