Net4x.Gtk.Windows.Forms 1.4.2463

dotnet add package Net4x.Gtk.Windows.Forms --version 1.4.2463
                    
NuGet\Install-Package Net4x.Gtk.Windows.Forms -Version 1.4.2463
                    
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="Net4x.Gtk.Windows.Forms" Version="1.4.2463" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.Gtk.Windows.Forms" Version="1.4.2463" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.Gtk.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 Net4x.Gtk.Windows.Forms --version 1.4.2463
                    
#r "nuget: Net4x.Gtk.Windows.Forms, 1.4.2463"
                    
#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.
#addin nuget:?package=Net4x.Gtk.Windows.Forms&version=1.4.2463
                    
Install Net4x.Gtk.Windows.Forms as a Cake Addin
#tool nuget:?package=Net4x.Gtk.Windows.Forms&version=1.4.2463
                    
Install Net4x.Gtk.Windows.Forms as a Cake Tool

GTKSystem.Windows.Forms

Introduction

Native Visual Studio Development, No Learning Required, Compile Once, Run Cross-Platform C# desktop application cross-platform (Windows, Linux, macOS) development framework, based on GTK components. With this framework, Visual Studio can use C#'s native WinForms form designer with the same properties, methods, and events as traditional WinForms development, requiring no additional learning. Compile once and run cross-platform. It facilitates cross-platform WinForms software development and enables upgrading existing C# WinForms applications to cross-platform solutions.

Project website: https://www.gtkapp.com

Software Architecture

Developed using .NET C# and GTK 3.24.24.95 as the UI framework, this system rewrites C#'s System.Windows.Forms components, ensuring compatibility with native C# program components.

Installation Guide

By default, when Visual Studio compiles a project with GtkSharp from NuGet, it automatically downloads the Gtk.zip runtime package and extracts it. This open-source project also includes the Gtk.zip package for manual installation. Below are three installation methods:

1. Automatic Installation (May Contain Older Libraries)

When you compile your project after installing GtkSharp, it automatically downloads gtk.zip and extracts it to the directory $(LOCALAPPDATA)\Gtk\3.24.24 to configure the GTK environment. However, due to network restrictions in some regions, automatic downloads may fail.

Downloading and installing the latest libraries using an EXE installer is recommended:

3. Installation via MSYS (For Latest Libraries)

Use MSYS to install GTK components. Search online for specific steps.

Installing .NET on Windows

Download the .NET SDK from Microsoft's official website: https://dotnet.microsoft.com/en-us/download

Installing GTK on Linux

# Debian/Ubuntu
sudo apt install gtk3

# Fedora
sudo apt install gtk3       # Binary package
sudo apt install gtk3-devel # Development package

# MSYS2
pacman -S mingw-w64-ucrt-x86_64-gtk3

# Verify installation (requires pkg-config):
pkg-config --cflags --libs gtk+-3.0

# Find GTK installation directory:
ldconfig -p | grep gtk

Installing .NET on Linux

Refer to Microsoft's official guide: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual

Development Guide

  1. Project Framework Selection:
    • Choose "Windows Application" and set UseWindowsForms to false, or select "Console Application" (for .NET 6+).
  2. Install Required NuGet Packages:
    • GtkSharp (3.24.24.95)
    • GTKSystem.Windows.Forms
    • GTKSystem.Windows.FormsDesigner
  3. Ensure Proper Image Resource Handling:
    • If using images, create System.Resources.ResourceManager and System.ComponentModel.ComponentResourceManager (detailed below).
  4. Compile the Project and Fix Form Designer Issues:
    • Use the built-in "Fix Form Designer" menu option or manually create designer.runtimeconfig.json in the obj directory.

Running the Software

  1. On Windows: Compile and run demo_app.exe or demo_app.dll in the Debug directory.
  2. On Linux/macOS: Run dotnet demo_app.dll.
  3. Cross-Platform Deployment: Projects using this framework can be compiled and deployed on Linux, generating a native Linux binary (without a file extension) that can be executed directly.

Visual Studio Plugin Installation

Tool 1: NuGet Installation

Install GTKSystem.Windows.FormsDesigner from NuGet to fix form designer issues during compilation.

Tool 2: VSIX Plugin Installation

Download the plugin tool, close Visual Studio, and install GTKWinformVSIXProject.vsix by double-clicking it. (Required if the project lacks Form templates.)

Features Installed by the Plugin:

  1. Form Templates: Adds templates for Forms and User Controls under "New Item".
  2. Context Menu: Adds a right-click menu for project-specific GTKWinForms tasks.

Visual Studio Plugin Screenshot

Project Configuration Steps

1. Create System.Resources.ResourceManager Class
  • Inherit from GTKSystem.Resources.ResourceManager to override native System.Resources.ResourceManager.
  • Handles reading project resource files and images.
  • (Skip this step if your project does not use resource files/images.)
2. Create System.ComponentModel.ComponentResourceManager Class
  • Inherit from GTKSystem.ComponentModel.ComponentResourceManager.
  • Enables resource and image file reading via GTKSystem.Resources.ResourceManager.
  • (Skip this step if unnecessary.)
3. Modify GTKWinFormsApp.csproj
  • Set UseWindowsForms to false in the project file:
    <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
      <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>net8.0</TargetFramework>
        <UseWindowsForms>false</UseWindowsForms>
    
4. Add Required References
  • Mandatory: GTKSystem.Windows.Forms
  • Optional: System.Resources.Extensions (only for resolving VS design-time exceptions).
5. Configure Runtime Files for Form Designer

Example GTKWinFormsApp.designer.runtimeconfig.json:

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "framework": {
      "name": "Microsoft.WindowsDesktop.App",
      "version": "8.0.0"
    }
  }
}

Support and Resources

Support GTKSystem
Contact GTKSystem

Common Issues

Why Can't I Open the Form Designer?

  1. Compile the project.
  2. Open the Form Designer.
  3. If issues persist:
    • Close the Form Designer.
    • Recompile the project.
    • Restart Visual Studio.
    • Open the Form Designer again.

Contribution

Contribute to this framework at:

Update History

For detailed updates, visit: Update History >>

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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. 
.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 is compatible.  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 Net4x.Gtk.Windows.Forms:

Package Downloads
Net4x.ConnectionStringLibrary

ConnectionString Library

Net4x.GtkSharpLibrary

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.2463 259 4/4/2025

C# interface cross-platform development component gtksystem-windows-forms