GithubHelp home page GithubHelp logo

wzg6540 / nanui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuanchenlin/nanui

0.0 1.0 0.0 4.66 MB

NanUI is a library based on ChromiumFX that can let your Winform application use HTML5/CSS3 as user interface. You can use orginal Winform borders or full view no border form that use all html/css to design the interface.

License: Other

C# 99.84% HTML 0.09% CSS 0.06% JavaScript 0.02%

nanui's Introduction

Welcome to NanUI

中文说明

NanUI is a library based on ChromiumFX that can let your Winform application use HTML5/CSS3 as user interface. You can use orginal Winform borders or full view no border form that use all html/css to design the interface.

NanUI is MIT licensed, so you can use it in both business and free/open source application. For more details, see the LICENSE file.

NanUI

What's new in version 0.6

  • Rewritted codes of no border interface logic, new version is faster than old versions.
  • NanUI now supports Hi-DPI in Windows 8 and later.
  • Combined HtmlUIForm and HtmlContentForm to one Formium which support these two styles.
  • Install Nuget Package of NanUI will add CEF and ChromiumFX dependencies to your application automatically.

Build NetDimension.NanUI.dll

You should use the complier which supports C# 7.0 syntax. Visual Studio 2017 is recommended.

Releases

Stable NanUI binaries are released on NuGet. Use following Nuget command to install latest version of NanUI to your Winfrom application. It will install CEF and CFX dependencies too and the dependencies will automatic copy to the bin folder.

NOTE: NanUI requires .Net Framework 4.0 as minimal support.

Nuget Package Manager

PM> Install-Package NetDimension.NanUI

Release of NetDimension.NanUI.XP

Another version of NanUI that supports Windows XP is now can be downloaded on Nuget by using following command:

PM> Install-Package NetDimension.NanUI.XP

Support for High Dpi Monitors You should add and modify Application Manifest File to enable this feature:

  1. Set DpiAware Attribute to true to enable high dpi support.
<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
        <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
    </windowsSettings>
</application>
  1. If you are running in Windows 8.1, set DpiAwareness Attribute to PerMonitor to enable per monitor diffirent dpi in mulit monitors.
<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
        <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
        <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
    </windowsSettings>
</application>
  1. If you are running in Windows 10 create update (or later), set DpiAwareness Attribute to PerMonitorV2 to enable per monitor diffirent dpi in mulit monitors with advanced features.
<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
        <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
        <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
    </windowsSettings>
</application>

Download Manually

Changes

Latest change at 2019/11/15, see here to check the details.

Basic Usage

Initialize Runtime in Main

namespace TestApplication
{
    using NetDimension.NanUI;
    static class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Initalize: set CEF paths
            //If you use default structure of the FX folder, you should provide paths of fx folder, resources folder and locales folder.

            var result = Bootstrap.Load();
            
            if (result)
            {
                // Load embedded html/css resources in assembly.
                Bootstrap.RegisterAssemblyResources(System.Reflection.Assembly.GetExecutingAssembly());

                Application.Run(new Form1());

                Application.Exit();
            }

        }
    }
}

Using native Winform border style

namespace TestApplication
{
    public partial class Form1 : WinFormium

    {

        public Form1()
            //Load embedded resource index.html and not set form to no border style by the second parameter.
            : base("http://res.app.local/index.html")
        {
            InitializeComponent();
        }
    }
}

Using no border style

namespace TestApplication
{
    public partial class Form1 : Formium

    {

        public Form1()
            //Load embedded resource index.html and set form to no border style by igrone the second parameter or set it to true.
            : base("http://res.app.local/index.html")
        {
            InitializeComponent();
        }
    }
}

Documentation

WiKi

Donate

If you like my work, please buy me a cup of coffee to encourage me continue with this library.

In China you can donate me by scaning the QR code below in Alipay or WeChat app.

Screen Shot

Or you can donate me by Paypal.

DONATE

nanui's People

Contributors

xuanchenlin avatar bronts avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.