#region
|
|
using System;
|
using System.Windows.Forms;
|
using DevExpress.XtraEditors;
|
|
#endregion
|
|
namespace CSFrameworkV5.Library.UserControls
|
{
|
public partial class ucPopupList : UserControl
|
{
|
public delegate void OnItemClickHandle(object item);
|
|
private OnItemClickHandle _OnItemClick;
|
|
public ucPopupList()
|
{
|
InitializeComponent();
|
}
|
|
public ListBoxControl ListBox => listData;
|
|
public PopupContainerControl PopupContainer => popupContainerControl1;
|
|
public void InitDataSource(string[] data)
|
{
|
listData.Items.Clear();
|
listData.Items.AddRange(data);
|
}
|
|
private void listData_Click(object sender, EventArgs e)
|
{
|
if (_OnItemClick != null) _OnItemClick(listData.SelectedItem);
|
}
|
|
public event OnItemClickHandle OnItemClick
|
{
|
add => _OnItemClick += value;
|
remove => _OnItemClick -= value;
|
}
|
|
private void ucPopupList_Load(object sender, EventArgs e)
|
{
|
//
|
}
|
}
|
}
|