53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using AntdUI;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AntdUIDemo.Views
|
|
{
|
|
public partial class GridPanelDemo : UserControl
|
|
{
|
|
public GridPanelDemo()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void buttonSPAN_Click(object sender, EventArgs e)
|
|
{
|
|
LoadGridPanel(input_span.Text, input_gap.Value);
|
|
}
|
|
|
|
private void LoadGridPanel(string spantext, decimal gap)
|
|
{
|
|
gridPanel.Controls.Clear();
|
|
gridPanel.Span = spantext;
|
|
gridPanel.Gap = (int)gap;
|
|
string[] array = spantext.Split(';', ' ', '\n');
|
|
for (int i = 0; i < array.Length; i++)
|
|
{
|
|
gridPanel.Controls.Add(new AntdUI.Button()
|
|
{
|
|
Text = "Button",
|
|
Type = TTypeMini.Primary,
|
|
WaveSize = 0,
|
|
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
|
|
});
|
|
}
|
|
}
|
|
|
|
private void buttonCZ_Click(object sender, EventArgs e)
|
|
{
|
|
input_gap.Value = 0;
|
|
var span = "50% 50%;50% 50%";
|
|
input_span.Text = span;
|
|
LoadGridPanel(span, 0);
|
|
}
|
|
}
|
|
}
|