SunnyUI 学习1.1——简介与界面布局的使用
程序开发
2023-09-06 21:54:07
1 简介
2 安装
可以参考官网的教程
3 布局模式
3.1 有哪些布局
3.2 如何使用
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApp1
{public partial class Form1 : UIHeaderMainFrame{public Form1(){InitializeComponent();}}
}
3.3 子布局
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApp1.Forms
{public partial class FAside : UIPage{public FAside(){InitializeComponent();}}
}
3.4 如何将3.3的子布局导入到3.2的布局中?
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WindowsFormsApp1.Forms;namespace WindowsFormsApp1
{public partial class Form1 : UIHeaderAsideMainFrame{public Form1(){InitializeComponent();int pageIndex = 1000;// Aside创建Controls节点,并给对应的page标号为pageIndexAside.CreateNode("Controls", 61451, pageIndex);// 添加Main布局的布局类FAside// FAside需要继承UIPage或者 UITitlePageAddPage(new FAside(), ++pageIndex);}}
}
3.5 Aside与Main关联
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WindowsFormsApp1.Forms;namespace WindowsFormsApp1
{public partial class Form1 : UIHeaderAsideMainFrame{public Form1(){InitializeComponent();int pageIndex = 1000;// Aside创建Controls节点,并给对应的page标号为pageIndex// FMain1需要继承UIPage或者 UITitlePage// 将Aside和指定的Main对应关联//TreeNode treeNode = new TreeNode();UIPage page = AddPage(new FMain1(), pageIndex);TreeNode treeNode = Aside.CreateNode(page, pageIndex + 10000, pageIndex);treeNode.Text = "Main1";// 需要将修改后的TreeNode重新装入Aside.SetNodeItem(treeNode, new NavMenuItem(page));pageIndex = 2000;// Aside创建Controls节点,并给对应的page标号为pageIndexpage = AddPage(new FMain2(), pageIndex);treeNode = Aside.CreateNode(page, pageIndex + 10000, pageIndex);treeNode.Text = "Main2";Aside.SetNodeItem(treeNode, new NavMenuItem(page));}}
}
标签:
上一篇:
vue面试常见知识点
下一篇:
相关文章
-
无相关信息