当前位置:网站首页>.NET-6.WinForm2.NanUI学习和总结
.NET-6.WinForm2.NanUI学习和总结
2022-07-31 04:43:00 【joyyi9】
NanUI学习和总结
前言
其实这个和electron.js,nw.js 差不多,任何html都可以嵌套进去;
也就是web开发都可以嵌入,angular,vue,react,node.js的web,都可以哦!
挺爽的。
其他小细节可以看文档。
参考文档:
官方文档
第一个NanUI程序:
1. 下载Nuget包:
NetDimension.NanUI
NetDimension.NanUI.Runtime
2. 建立一个Winform程序
3. 创建主窗体:MainWindow.cs
4. 初始化在Main方法中
5. 运行
MainWindow.cs:
using NetDimension.NanUI;
using NetDimension.NanUI.HostWindow;
class MainWindow : Formium
{
// 设置窗体样式类型
public override HostWindowType WindowType => HostWindowType.System;
// 指定启动 Url
public override string StartUrl => "https://www.bing.com";
public MainWindow()
{
// 在此处设置窗口样式
Size = new System.Drawing.Size(1024, 768);
}
protected override void OnReady()
{
// 在此处进行浏览器相关操作
//ShowDevTools();
//ExecuteJavaScript("alert('Hello NanUI')");
}
}
Program.cs:
using NetDimension.NanUI;
class Program
{
static void Main()
{
// ...
WinFormium.CreateRuntimeBuilder(env => {
env.CustomCefSettings(settings =>
{
// 在此处设置 CEF 的相关参数
});
env.CustomCefCommandLineArguments(commandLine =>
{
// 在此处指定 CEF 命令行参数
});
}, app =>
{
// 指定启动窗体
app.UseMainWindow(context => new MainWindow());
})
.Build()
.Run();
}
}
总结
继续学习。
边栏推荐
- exsl文件预览,word文件预览网页方法
- 马斯克对话“虚拟版”马斯克,脑机交互技术离我们有多远
- Visual studio shortcuts that improve efficiency, summary (updated from time to time)
- Postgresql 15 source code analysis (5) - pg_control
- From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)
- [C language] General method of base conversion
- On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
- 高等数学---第九章二重积分
- MySQL数据库增删改查(基础操作命令详解)
- binom二项分布,
猜你喜欢

Understanding and Using Unity2D Custom Scriptable Tiles (4) - Start to build a custom tile based on the Tile class (below)

专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础

行业落地呈现新进展 | 2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛圆满召开

MySQL数据库备份

扫雷游戏(c语言写)

The input input box displays the precision of two decimal places

聚变云原生,赋能新里程 | 2022开放原子全球开源峰会云原生分论坛圆满召开

View source and switch mirrors in two ways: npm and nrm

Notes on the establishment of the company's official website (6): The public security record of the domain name is carried out and the record number is displayed at the bottom of the web page

Basic knowledge of mysql (2)
随机推荐
Unity打灵狐者
idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘
STM32HAL库修改Hal_Delay为us级延时
MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行
数字经济时代的开源数据库创新 | 2022开放原子全球开源峰会数据库分论坛圆满召开
MySQL数据库必会的增删查改操作(CRUD)
【debug锦集】Expected input batch_size (1) to match target batch_size (0)
Safety 20220715
简易网络文件拷贝的C实现
IDEA common shortcut keys and plug-ins
开放原子开源基金会秘书长孙文龙 | 凝心聚力,共拓开源
Why don't you programmers make a living off your own projects?And have to work for someone else?
qlib架构
MySQL 8.0.30 GA
两个地址池r2负责管地址池r1负责管dhcp中继
三子棋的代码实现
HCIP Day 10_BGP Route Summary Experiment
慧通编程第4关 - 魔法学院第6课
Reinforcement learning: from entry to pit to shit
MySQL fuzzy query can use INSTR instead of LIKE