Location>code7788 >text

NET Multi-Version WinForm Open Source Controls Library SunnyUI

Popularity:192 ℃/2024-09-12 11:03:12

preamble

To recommend an open source Winform control library that can help us develop more beautiful, beautiful WinForm interface.

Projects

NET Framework 4.0+, .NET 6, .NET 7 and .NET 8 based WinForm open source control library , but also provides a library of tools , extensions and multi-page development framework .

NET Framework 4.0, developed with native controls, referencing the Element theme style, it includes over 70 commonly used controls, such as buttons, edit boxes, dropdowns, datagrids, industrial gauges, and statistical charts, to satisfy regular development needs, with each control carefully designed with attention to detail.

Provides 11 Element style themes and 6 other themes, supports colorful theme mode customization. Includes UIStyleManager, a theme management component, which allows you to switch themes freely.

Project Architecture

The control library has different themes, fonts and languages, including common components Button, Label, CheckBox, TreeView and TabControl, dialog boxes, progress bars, message alerts, provides extension libraries and tool libraries, convenient for us to develop and use, the specific details are shown in the figure below:

Project environment

1. Source code compilation environment

VS 2022, installing .NET Framework 4.0 target package

NET 8 requires VS 2022 version 17.8+, or modify the TargetFrameworks property of the file to fit the VS environment.

2. Dynamic library application environment

NET Framework 4.0+, .NET 6, .NET 7, VS 2010 and above.

Recommended installation via Nuget

PM->Install-Package SunnyUI

Or search for SunnyUI installation via Nuget, not supported (.NET Framework 4)Client Profile)。

Project Showcase

1. Theme

SunnyUI uses a specific set of palettes to specify colors in order to avoid visual communication differences and provide a consistent look and feel for the products you build.

The main colors refer to Element (/

predominant

SunnyUI's primary brand color is a bright, friendly blue.

Style Theme

SunnyUI includes 11 Element style themes, 3 DotNetBar themes, 2 other themes, and UIStyleManager, a theme management component, which allows you to switch themes freely.

2. Internationalization

The SunnyUI control uses Chinese internally by default. If you want to use other languages, you need to set up multi-language settings.

The internationalization described on this page is for Chinese resources such as buttons and titles in SunnyUI.If you develop a system that requires internationalization, please develop it yourself.

Commonly used text such as buttons, titles, prompts, etc. have been set as static string variables that are stored in the file.

public static class UILocalize
{
    public static string InfoTitle = "draw attention to sth.";
    public static string SuccessTitle = "properly";
    public static string WarningTitle = "warnings";
    public static string ErrorTitle = "incorrect";
    public static string AskTitle = "draw attention to sth.";
    public static string InputTitle = "importation";
    public static string CloseAll = "Close all";
    public static string OK = "recognize";
    public static string Cancel = "abolish";
    public static string GridNoData = "[ No data available ]";
    public static string GridDataLoading = "Data loading ......";
    public static string GridDataSourceException = "The data source must be a DataTable or List.";
}

You can override the UILocalize class static variable values to change the language.

The UILocalizeHelper class already contains default configuration functions for Chinese and English:

public static class UILocalizeHelper
{
    public static void SetEN()
    {
         = "Info";
         = "Success";
         = "Warning";
         = "Error";
         = "Query";
         = "Input";
         = "Close all";
         = "OK";
         = "Cancel";
         = "[ No data ]";
         = "Data loading ......";
         = "The data source must be DataTable or List";
    }
​
    public static void SetCH()
    {
         = "draw attention to sth.";
         = "properly";
         = "warnings";
         = "incorrect";
         = "draw attention to sth.";
         = "importation";
         = "Close all";
         = "recognize";
         = "abolish";
         = "[ No data available ]";
         = "Data loading ......";
         = "The data source must be a DataTable or List.";
    }
}

If you need another language, just write a function in your own program to update the value of the UILocalize class static variable.

Chinese and English effects are shown:

3. Font Icons

SunnyUI has two main font icons at the moment:

FontAwesome

/

/FortAwesome/Font-Awesome

V1.0

/blog/resources/elegant-icon-font

These two are currently commonly used font icons for Web development, SunnyUI after careful research and development, they will be used for .NET Winform development, eliminating the need to look for icons everywhere.

SunnyUI's common controls for font icons are UISymbolButton and UISymbolLabel.

Font icons are selected by setting the following properties of UISymbolButton and UISymbolLabel

Symbol: font icon (int)

SymbolSize: size of the font icon (int)

4、Control library

Commonly used all kinds of components are available, the specific content can download the source code to learn.

5. Forms

UIForm Commonly used form base classes

UILoginForm: login form base class

6、Multi-page framework

SunnyUI multi-page framework consists of frames and pages. The most basic implementation is that the frame (IFrame) is implemented by UIForm and the page is implemented by (UIPage).

Place a UITabControl in the UIForm and place multiple UIPages inside the TabPage of the UIForm's UITabControl.

Associate and switch pages by PageIndex (positive integer, unique).

Sounds a little complicated, in fact, the main IFrame interface on the three functions: AddPage, ExistPage, SelectPage.

7. Tools library

Simple Json static library , you can not reference NewtonJson that can be simple to deal with Json objects . Of course, if you have complex needs, third-party libraries or recommended NewtonJson. In addition, in .NET 5, the performance has been very good, you can also try.

Project Address

GitHub:/yhuse/SunnyUI

Gitee:/yhuse/SunnyUI

Help file:/yhuse/SunnyUI/wikis/pages

ultimate

If you found this article helpful, why not support it with a like? Your support is what keeps me motivated to continue sharing my knowledge. Feel free to leave a comment if you have any questions or need further help.

You can also join WeChat[DotNet Technician] community to share ideas and grow with other tech-loving peers!Excellence is a habit, so feel free to leave a comment and learn!