1
yhj
2024-07-24 5e5d945e91568b973faa27d8ab0bcef99fc4a6c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#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)
        {
            //
        }
    }
}