当前位置:网站首页>.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();
}
}
总结
继续学习。
边栏推荐
- "A daily practice, happy water problem" 1331. Array serial number conversion
- LocalDate addition and subtraction operations and comparison size
- No qualifying bean of type question
- Visual studio shortcuts that improve efficiency, summary (updated from time to time)
- VScode+ESP32 quickly install ESP-IDF plugin
- VScode+ESP32快速安装ESP-IDF插件
- (四)递归、可变参数、访问修饰符、理解 main 方法、代码块
- (八)Math 类、Arrays 类、System类、Biglnteger 和 BigDecimal 类、日期类
- Learning DAVID Database (1)
- open failed: EACCES (Permission denied)
猜你喜欢

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

高等数学---第九章二重积分

MySQL数据库备份

微信小程序使用云函数更新和添加云数据库嵌套数组元素

Solved (the latest version of selenium framework element positioning error) NameError: name 'By' is not defined

三子棋的代码实现

Component pass value provide/inject

从零开始,一镜到底,纯净系统搭建除草机(Grasscutter)

XSS靶场(三)prompt to win

MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行
随机推荐
【AUTOSAR-RTE】-4-Port and Interface and Data Type
Safety 20220722
View source and switch mirrors in two ways: npm and nrm
$parent/$children and ref
Safety 20220715
(Line segment tree) Summary of common problems of basic line segment tree
简易网络文件拷贝的C实现
Why don't you programmers make a living off your own projects?And have to work for someone else?
[C language] General method of base conversion
Industry landing presents new progress | 2022 OpenAtom Global Open Source Summit OpenAtom OpenHarmony sub-forum was successfully held
(tree) Last Common Ancestor (LCA)
Visual studio shortcuts that improve efficiency, summary (updated from time to time)
(4) Recursion, variable parameters, access modifiers, understanding main method, code block
从零开始,一镜到底,纯净系统搭建除草机(Grasscutter)
Vue项目通过node连接MySQL数据库并实现增删改查操作
MySQL 8.0.30 GA
【线性神经网络】softmax回归
MySQL基础操作
高斯分布及其极大似然估计
unity2d game