41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
|
|
using System;
|
|||
|
|
using System.ComponentModel.Design;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
|
|||
|
|
namespace CPSO.Forms._92_Knowledge
|
|||
|
|
{
|
|||
|
|
public class MyCollectionEditor: CollectionEditor
|
|||
|
|
{
|
|||
|
|
public MyCollectionEditor(Type type) : base(type)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected override CollectionForm CreateCollectionForm()
|
|||
|
|
{
|
|||
|
|
var collectionForm = base.CreateCollectionForm();
|
|||
|
|
|
|||
|
|
var control = collectionForm.Controls.Find("addRemoveTableLayoutPanel", true).First();
|
|||
|
|
|
|||
|
|
if (!(control is TableLayoutPanel addRemoveTableLayoutPanel))
|
|||
|
|
return collectionForm;
|
|||
|
|
|
|||
|
|
addRemoveTableLayoutPanel.ColumnCount = 2;
|
|||
|
|
|
|||
|
|
control = collectionForm.Controls.Find("addButton", true).First();
|
|||
|
|
if (control is Button addButton)
|
|||
|
|
{
|
|||
|
|
addButton.Text = @"增加";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
control = collectionForm.Controls.Find("removeButton", true).First();
|
|||
|
|
if (control is Button removeButton)
|
|||
|
|
{
|
|||
|
|
removeButton.Text = @"移除";
|
|||
|
|
addRemoveTableLayoutPanel.SetColumn(removeButton, 1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return collectionForm;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|