using System; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; namespace FastReport.Dialog { /// /// Represents a Windows control to display a list of items. /// Wraps the control. /// public class ListBoxControl : ListBoxBaseControl { private ListBox listBox; #region Properties /// /// Gets an internal ListBox. /// [Browsable(false)] public ListBox ListBox { get { return listBox; } } #endregion #region Protected Methods /// protected override object GetValue() { List list = new List(); foreach (object item in SelectedItems) { list.Add((string)item); } return list.ToArray(); } #endregion #region Public Methods /// public override void OnSelectedIndexChanged(EventArgs e) { OnFilterChanged(); base.OnSelectedIndexChanged(e); } #endregion /// /// Initializes a new instance of the ListBoxControl class with default settings. /// public ListBoxControl() { listBox = new ListBox(); Control = listBox; ListBox.IntegralHeight = false; BindableProperty = this.GetType().GetProperty("SelectedItem"); } } }