本文整理匯總了C#中System.Windows.Forms.Menu.WithBorder方法的典型用法代碼示例。如果您正苦於以下問題:C# Menu.WithBorder方法的具體用法?C# Menu.WithBorder怎麽用?C# Menu.WithBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.Menu
的用法示例。
在下文中一共展示了Menu.WithBorder方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MainWindow
public MainWindow()
: base("MD", 640, 480)
{
this.WindowState = WindowState.Maximized;
// Client area
VariableContainer clientarea = new VariableContainer();
// Menu items
MenuItem[] menuitems = new MenuItem[]
{
MenuItem.Create("File", new MenuItem[]
{
MenuItem.Create("Import", delegate
{
using(var fd = new WinForms.OpenFileDialog())
{
fd.Filter = "MP3 Files |*.mp3";
if (fd.ShowDialog() == WinForms.DialogResult.OK)
{
string file = fd.FileName;
AudioContext ac = new AudioContext();
MemoryAudioSource mas = new MP3AudioFeed(file).Copy(4096, 4096 * 100);
SpectrogramView sp = new SpectrogramView(mas);
clientarea.Client = sp;
AudioOutput ao = new AudioOutput(mas.Play);
ao.Play();
}
else
{
return;
}
}
}),
MenuItem.Create("Exit", delegate
{
this.Close();
})
})
};
// Menu and splitter
Menu menu = new Menu(menuitems);
SplitContainer sc = new SplitContainer(Axis.Vertical, menu.WithBorder(0.0, 0.0, 0.0, 1.0), clientarea);
sc.NearSize = 30.0;
// Main layer container
LayerContainer lc = new LayerContainer(sc);
this.Control = lc;
}