You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.6 KiB
C#
129 lines
3.6 KiB
C#
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 Mesnac.Controls.Intake.Base
|
|
{
|
|
public partial class LinkControlForm : Form
|
|
{
|
|
public List<string> InitContorl = new List<string>();
|
|
private string _linkControl = null;
|
|
public string LinkControl
|
|
{
|
|
get { return _linkControl; }
|
|
set { _linkControl = value; }
|
|
}
|
|
public LinkControlForm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
public LinkControlForm(string link)
|
|
{
|
|
InitializeComponent();
|
|
_linkControl = link;
|
|
lsSelect.Items.Clear();
|
|
if (link != null)
|
|
{
|
|
if (link.Length > 0)
|
|
{
|
|
lsSelect.Items.Add(link);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void btn_OK_Click(object sender, EventArgs e)
|
|
{
|
|
if (lsSelect.Items.Count > 0)
|
|
{
|
|
_linkControl = lsSelect.Items[0].ToString();
|
|
}
|
|
}
|
|
|
|
private void lsInit_MouseDoubleClick(object sender, MouseEventArgs e)
|
|
{
|
|
if (lsInit.SelectedIndex >= 0)
|
|
{
|
|
if (lsSelect.Items.Count == 0)
|
|
{
|
|
lsSelect.Items.Add(lsInit.SelectedItem.ToString());
|
|
lblMes.Text = "";
|
|
}
|
|
else
|
|
{
|
|
lblMes.Text =lblName.Text+ "控件只有一个流动输出";
|
|
}
|
|
}
|
|
}
|
|
|
|
private void lsSelect_MouseDoubleClick(object sender, MouseEventArgs e)
|
|
{
|
|
if (lsSelect.SelectedIndex >= 0)
|
|
{
|
|
lsSelect.Items.Remove(lsSelect.SelectedItem);
|
|
lblMes.Text = "";
|
|
}
|
|
}
|
|
|
|
private void btnAdd_Click(object sender, EventArgs e)
|
|
{
|
|
if (lsInit.SelectedIndex >= 0)
|
|
{
|
|
if (lsSelect.Items.Count == 0)
|
|
{
|
|
lsSelect.Items.Add(lsInit.SelectedItem.ToString());
|
|
lblMes.Text = "";
|
|
}
|
|
else
|
|
{
|
|
lblMes.Text = lblName.Text + "控件只有一个流动输出";
|
|
}
|
|
}
|
|
}
|
|
|
|
private void btnCan_Click(object sender, EventArgs e)
|
|
{
|
|
if (lsSelect.SelectedIndex >= 0)
|
|
{
|
|
lsSelect.Items.Remove(lsSelect.SelectedItem);
|
|
lblMes.Text = "";
|
|
}
|
|
}
|
|
|
|
private void tvType_AfterSelect(object sender, TreeViewEventArgs e)
|
|
{
|
|
if (tvType.SelectedNode != null)
|
|
{
|
|
lsInit.Items.Clear();
|
|
if (tvType.SelectedNode.Parent == null)
|
|
{
|
|
foreach (string item in InitContorl)
|
|
{
|
|
lsInit.Items.Add(item);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
foreach (string item in InitContorl)
|
|
{
|
|
if (item.IndexOf(tvType.SelectedNode.Tag.ToString()) >= 0)
|
|
{
|
|
lsInit.Items.Add(item);
|
|
}
|
|
}
|
|
}
|
|
lsInit.Sorted = true;
|
|
}
|
|
}
|
|
|
|
private void LinkControlForm_Load(object sender, EventArgs e)
|
|
{
|
|
tvType.ImageList = imageList1;
|
|
}
|
|
}
|
|
}
|