當前位置: 首頁>>代碼示例>>C#>>正文


C# ToolStripDropDown.DefaultDropDownDirection屬性代碼示例

本文整理匯總了C#中System.Windows.Forms.ToolStripDropDown.DefaultDropDownDirection屬性的典型用法代碼示例。如果您正苦於以下問題:C# ToolStripDropDown.DefaultDropDownDirection屬性的具體用法?C# ToolStripDropDown.DefaultDropDownDirection怎麽用?C# ToolStripDropDown.DefaultDropDownDirection使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在System.Windows.Forms.ToolStripDropDown的用法示例。


在下文中一共展示了ToolStripDropDown.DefaultDropDownDirection屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: radioButton1_CheckedChanged

// The following methods handle the CheckChanged event 
// for all the radio buttons. Each method calls a utility
// method to set the ToolStripDropDownDirection appropriately.

private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.AboveLeft);
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.AboveRight);
}

private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.BelowLeft);
}

private void radioButton4_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.BelowRight);
}

private void radioButton5_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.Default);
}

private void radioButton6_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.Left);
}

private void radioButton7_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.Right);
}

// This utility method sets the DefaultDropDownDirection property.
private void HandleRadioButton(object sender, ToolStripDropDownDirection direction)
{
    RadioButton rb = sender as RadioButton;

    if (rb != null)
    {
        if (rb.Checked)
        {
            this.dropDownDirection = direction;
            this.contextMenuStrip1.DefaultDropDownDirection = direction;
        }
    }
}
開發者ID:.NET開發者,項目名稱:System.Windows.Forms,代碼行數:53,代碼來源:ToolStripDropDown.DefaultDropDownDirection


注:本文中的System.Windows.Forms.ToolStripDropDown.DefaultDropDownDirection屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。