当前位置:网站首页>.NET-6.WinForm2.NanUI learning and summary
.NET-6.WinForm2.NanUI learning and summary
2022-07-31 04:55:00 【joyyi9】
NanUI学习和总结
前言
其实这个和electron.js,nw.js 差不多,任何htmlcan be embedded in;
也就是webDevelopment can be embedded,angular,vue,react,node.js的web,都可以哦!
挺爽的.
See the documentation for other small details.
参考文档:
官方文档
第一个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();
}
}
总结
继续学习.
边栏推荐
- Explanation of
- Open Source Database Innovation in the Digital Economy Era | 2022 Open Atom Global Open Source Summit Database Sub-Forum Successfully Held
- PCL calculates the point cloud coordinate maximum and its index
- ERP Production Operation Control Kingdee
- Blockbuster | foundation for platinum, gold, silver gave nameboards donors
- XSS靶场(三)prompt to win
- From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)
- ENSP, VLAN division, static routing, comprehensive configuration of Layer 3 switches
- 重磅 | 开放原子校源行活动正式启动
- Heavyweight | The Open Atomic School Source Line activity was officially launched
猜你喜欢
From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)
DVWA shooting range environment construction
【wpf】wpf中的那些模板之深度解析
Lua,ILRuntime, HybridCLR(wolong)/huatuo hot update comparative analysis
重磅 | 开放原子校源行活动正式启动
【云原生】DevOps(五):集成Harbor
1. Get data - requests.get()
The Vue project connects to the MySQL database through node and implements addition, deletion, modification and query operations
prompt.ml/15中<svg>标签使用解释
[debug highlights] Expected input batch_size (1) to match target batch_size (0)
随机推荐
Unity资源管理系列:Unity 框架如何做好资源管理
View source and switch mirrors in two ways: npm and nrm
CentOS7 —— yum安装mysql
Solved (the latest version of selenium framework element positioning error) NameError: name 'By' is not defined
Unity Fighter
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
PWN ROP
Go language study notes - dealing with timeout problems - Context usage | Go language from scratch
HCIP Day 10_BGP Route Summary Experiment
Unity框架设计系列:Unity 如何设计网络框架
Open Source Smart Future | 2022 OpenAtom Global Open Source Summit OpenAtom openEuler sub-forum was successfully held
Visual studio shortcuts that improve efficiency, summary (updated from time to time)
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
【wpf】wpf中的那些模板之深度解析
Puzzle Game Level Design: Reverse Method--Explaining Puzzle Game Level Design
MySQL忘记密码怎么办
STM32——DMA
重磅 | 基金会为白金、黄金、白银捐赠人授牌
STM32HAL library modifies Hal_Delay to us-level delay