当前位置:网站首页>.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文件预览网页方法
- ENSP,划分VLAN、静态路由,三层交换机综合配置
- mysql基础知识(二)
- 高斯分布及其极大似然估计
- HCIP第十天_BGP路由汇总实验
- 扫雷小游戏——C语言
- Visual studio shortcuts that improve efficiency, summary (updated from time to time)
- Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
- 产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开
- MySQL模糊查询可以使用INSTR替代LIKE
猜你喜欢
【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
Port inspection steps - 7680 port analysis - Dosvc service
From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)
从零开始,一镜到底,纯净系统搭建除草机(Grasscutter)
(五)final、抽象类、接口、内部类
mysql数据库安装(详细)
[Swift] Customize the shortcut that pops up by clicking the APP icon
HCIP Day 10_BGP Route Summary Experiment
C language from entry to such as soil, the data store
扫雷游戏(c语言写)
随机推荐
MySQL模糊查询可以使用INSTR替代LIKE
两个地址池r2负责管地址池r1负责管dhcp中继
[AUTOSAR-RTE]-5-Explicit (explicit) and Implicit (implicit) Sender-Receiver communication
el-image标签绑定点击事件后没有有用
STM32HAL库修改Hal_Delay为us级延时
[CV project debugging] CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT problem
C language confession code?
Recursive implementation of the Tower of Hanoi problem
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
Port inspection steps - 7680 port analysis - Dosvc service
WeChat applet uses cloud functions to update and add cloud database nested array elements
XSS shooting range (3) prompt to win
Win10 CUDA CUDNN 安装配置(torch paddlepaddle)
MySQL修改root账号密码
Regarding the primary key id in the mysql8.0 database, when the id is inserted using replace to be 0, the actual id is automatically incremented after insertion, resulting in the solution to the repea
binom二项分布,
Reinforcement learning: from entry to pit to shit
Redis uses LIST to cache the latest comments
【py脚本】批量二值化处理图像
IDEA common shortcut keys and plug-ins