What is recommended in this issue is a . SunnyUI, the C# open-source control library of the Net Framework framework.
SunnyUI.Net is based on . Net Framework 4.0+、. Net 5、. C# WinForm open-source control library, tool class library, extension class library, and multi-page development framework for the Net 6 framework.
Software frameworks
Features
Open-source control library
Based on. Net Framework4.0, native control development, referring to the Element theme style, including buttons, edit boxes, drop-down boxes, data tables, industrial control instruments, statistical charts, including more than 70 commonly used controls, to meet the needs of general development, each control is meticulously crafted, attention to detail
Contains 11 Element-style themes and 6 other themes, and you can customize the theme through the colorful theme mode. Includes the theme management component UIStyleManager, which can switch themes freely
Utility libraries and extension libraries
Collect and organize the tool libraries that are often used in the development process.
IniFile – Ini file read/write class
Read the file
IniFile ini = new IniFile(“D:setup.ini”);
string name = ini. ReadString(“Setup”, “Name”, “”);
int age = ini. ReadInt(“Setup”, “Age”, 0);
Write the file
IniFile ini = new IniFile(“D:setup.ini”);
ini. Write(“Setup”, “Name”, “Sunny”);
ini. Write(“Setup”, “Age”, 18);
ini. UpdateFile();
IniConfig – The ini configuration file class
There is such a configuration file that saves the address and port of the server, the name of the software, and the name of the city in the software that is needed to display the weather. The configuration file class code is as follows:
[ConfigFile(“ConfigSetting.ini”)]
public class Setting : IniConfig<Setting>
{
[ConfigSection(“Hello”)]
public string SoftName { get; set; }
public string ServerIP { get; set; }
public int ServerPort { get; set; }
public string City { get; set; }
public override void SetDefault()
{
base. SetDefault();
SoftName = “XX Software”;
ServerIP = “192.168.1.2”;
ServerPort = 9090;
City = “Nanjing”;
}
}
Json – Simple Json static class
Converts the specified Json string input to an object of type T
public static T Deserialize(string input)
Convert object obj to Json string
public static string Serialize(object obj)
Read strings from a file to an object of type T
public static T DeserializeFromFile(string filename, Encoding encoding)
Convert object obj to Json string and save it to a file
public static string SerializeToFile(object obj, string filename, Encoding encoding)
Multi-page frames
Reference Element, including 7 common framework styles, only a few lines of simple code to create a multi-page program, its supporting components include UIForm, UIPage, UIFrame, a collection of common control libraries can be used to quickly develop WinForm applications.
Install and use
1 Nuget Installation
Nuget installation is the most convenient and fast way for Visual Studio to reference control packages.
Installation method 1: Install through the PM command:
Install-Package SunnyUI -Version 3.0.4
Installation method 2: Search for SunnyUI installation through the Nuget package manager:
2 Download and Install
Open SunnyUI’s code cloud address:
https://gitee.com/yhuse/SunnyUI 。 Click “Clone/Download”, click “Download ZIP”, and follow the prompts to download SunnyUI.
Download the yhuse-SunnyUI-master.zip, then unzip it, and directly reference the compiled dll file, the path is SunnyUIBinnet40SunnyUI.dll, SunnyUIBinnet40SunnyUI.Common.dll, both of which must be referenced.
Create a new Winform project or open your existing Winform project, select the form, display the form designer interface, click “View” – “Toolbox” to display the toolbox, as shown in the following figure:
In the toolbox, right-click and add a tab:
Enter SunnyUI:
Select the SunnyUI tab in the toolbox.
Installation method one: According to the prompt “There are no controls available in this group. Drag an item to this text to add it to the toolbox”, drag SunnyUIBinnet40SunnyUI.dll to the tooltip text, and the SunnyUI controls will be installed automatically
- Installation method 2: Right-click and select the item
On the .NET Framework Components page, click Browse, and select SunnyUIBinnet40SunnyUI.dll:
Click the OK button to add the SunnyUI component to the tab:
Okay, that’s it.
This project uses the GPL3.0 open source license, and you can read more content by yourself.