문제

When i select any option from the drop-down of the Menu-strip control, the Code in its Click event is fired and the drop-down collapses. But i want that drop-down must stay open.

Please help

If i open a dialog on click of the item in this menu, the opened menu always remain in front of the dialog. How to send it to back?

도움이 되었습니까?

해결책

if the Reception is of type ToolStripMenuItem you can just do this :

Reception.DropDown.AutoClose = false;

You need to do that for Lab, Admin .. if you want the same effect for them.

PS : The Menu would stay open even if it loses focus. so you need to close it manually/programatically.

Alternatively (Which I think is more efficient), handle the closing event for the dropdown and cancel the closing if the CloseReason is ItemClicked.

Reception.DropDown.Closing += new ToolStripDropDownClosingEventHandler(DropDown_Closing);

private void DropDown_Closing(object sender, ToolStripDropDownClosingEventArgs e)
    {
        if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked || e.CloseReason == ToolStripDropDownCloseReason.AppFocusChange)
           e.Cancel = true;
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top