/// <summary> /// Opens this instance. /// </summary> public void Open() { if (OnOpening != null) { var args = new SquidEventArgs(); OnOpening(this, args); if (args.Cancel) { return; } } if (HotDrop && Dropdown.Controls.Count == 0) { return; } Dropdown.Owner = Parent; switch (Align) { case Alignment.BottomLeft: Dropdown.Position = Location + new Point(0, Size.Y); break; case Alignment.TopRight: Dropdown.Position = Location + new Point(Size.X, 0); break; case Alignment.TopLeft: Dropdown.Position = Location - new Point(Dropdown.Size.X, 0); break; } Desktop.ShowDropdown(Dropdown, true); IsOpen = true; if (OnOpened != null) { OnOpened(this, null); } }
public void Open() { if (OnOpening != null) { var args = new SquidEventArgs(); OnOpening(this, args); if (args.Cancel) { return; } } if (!_wasOpenOnce) { if (DropdownAutoSize) { Dropdown.Size = new Point(Size.X, DropdownSize.Y); } else { Dropdown.Size = new Point(DropdownSize.X, DropdownSize.Y); } _wasOpenOnce = true; } Dropdown.Position = Location + new Point(0, Size.Y); Desktop.ShowDropdown(Dropdown, false); IsOpen = true; if (OnOpened != null) { OnOpened(this, null); } }