/// <summary>Raises the selection event</summary> protected void RaiseSelectionEvent(ListBox sender, bool wasTriggeredByUser) { // Discard events triggered programatically if these types of events haven't been // enabled if (!Parent.IsUsingNonUserEvents && !wasTriggeredByUser) return; // Fire the event if (Selection != null) Selection(sender, EventArgs.Empty); }
/// <summary>Adds a listbox control to the dialog</summary> public ListBox AddListBox(int id, int x, int y, int w, int h, ListBoxStyle style) { // First create the listbox ListBox c = new ListBox(this); // Now call the add control method AddControl(c); // Set the properties of the button now c.ID = id; c.SetLocation(x, y); c.SetSize(w,h); c.Style = style; return c; }