当前位置:网站首页>.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();
}
}
总结
继续学习。
边栏推荐
- 【py脚本】批量二值化处理图像
- MySQL database must add, delete, search and modify operations (CRUD)
- RESTful api interface design specification
- Safety 20220722
- Open Source Database Innovation in the Digital Economy Era | 2022 Open Atom Global Open Source Summit Database Sub-Forum Successfully Held
- 从零开始,一镜到底,纯净系统搭建除草机(Grasscutter)
- Understanding and Using Unity2D Custom Scriptable Tiles (4) - Start to build a custom tile based on the Tile class (below)
- (tree) Last Common Ancestor (LCA)
- ClickHouse:设置远程连接
- Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
猜你喜欢
Recursive implementation of the Tower of Hanoi problem
Port inspection steps - 7680 port analysis - Dosvc service
[Paper reading] Mastering the game of Go with deep neural networks and tree search
扫雷小游戏——C语言
BUG destroyer!!Practical debugging skills are super comprehensive
The input input box displays the precision of two decimal places
重磅 | 开放原子校源行活动正式启动
论治理与创新 | 2022开放原子全球开源峰会OpenAnolis分论坛圆满召开
MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行
(4) Recursion, variable parameters, access modifiers, understanding main method, code block
随机推荐
Visual studio shortcuts that improve efficiency, summary (updated from time to time)
npm、nrm两种方式查看源和切换镜像
(tree) Last Common Ancestor (LCA)
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
prompt.ml/15中<svg>标签使用解释
MySQL模糊查询可以使用INSTR替代LIKE
qlib自动化quant
已解决(最新版selenium框架元素定位报错)NameError: name ‘By‘ is not defined
Why don't you programmers make a living off your own projects?And have to work for someone else?
RESTful api interface design specification
重磅 | 开放原子校源行活动正式启动
View source and switch mirrors in two ways: npm and nrm
Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
[Linear Neural Network] softmax regression
qlib架构
BUG destroyer!!Practical debugging skills are super comprehensive
interprocess communication
(5) final, abstract class, interface, inner class
Understanding of the presence of a large number of close_wait states
递归实现汉诺塔问题