本文整理汇总了C#中System.Windows.Forms类的典型用法代码示例。如果您正苦于以下问题:C# Forms类的具体用法?C# Forms怎么用?C# Forms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Forms类属于System.Windows命名空间,在下文中一共展示了Forms类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Wrap
private static Screen Wrap(WinForms.Screen screen)
{
if (screen == null)
return null;
else
return new Screen(screen);
}
开发者ID:hosiminn,项目名称:StarryEyes,代码行数:7,代码来源:Screen.cs
示例2: OnVlcControlNeedsLibDirectory
private void OnVlcControlNeedsLibDirectory(object sender, Forms.VlcLibDirectoryNeededEventArgs e)
{
var currentAssembly = Assembly.GetEntryAssembly();
var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
if (currentDirectory == null)
return;
if (AssemblyName.GetAssemblyName(currentAssembly.Location).ProcessorArchitecture == ProcessorArchitecture.X86)
e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\lib\x86\"));
else
e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\lib\x64\"));
}
开发者ID:briancowan,项目名称:Vlc.DotNet,代码行数:11,代码来源:MainWindow.xaml.cs
示例3: Screen
private Screen(WinForms.Screen wfScreen)
{
if (wfScreen == null)
throw new ArgumentNullException("wfScreen");
_original = wfScreen;
if (Environment.OSVersion.Platform == PlatformID.Win32NT &&
Environment.OSVersion.Version >= Windows8)
{
var monitor = NativeMethods.MonitorFromPoint(
new System.Drawing.Point((int)WorkingArea.Left, (int)WorkingArea.Top), 2);
NativeMethods.GetDpiForMonitor(monitor, DpiType.Effective, out _dpiX, out _dpiY);
}
else
{
var g = Graphics.FromHwnd(IntPtr.Zero);
var desktop = g.GetHdc();
_dpiX = (uint)NativeMethods.GetDeviceCaps(desktop, (int)DeviceCap.LOGPIXELSX);
_dpiY = (uint)NativeMethods.GetDeviceCaps(desktop, (int)DeviceCap.LOGPIXELSY);
}
}
开发者ID:karno,项目名称:StarryEyes,代码行数:22,代码来源:Screen.cs
示例4: create
public static WPF_Ribbon create(WinForms.Control control, string title)
{
var ribbon = control.add_Ribbon_WithLogViewer(title);
ribbon.title(title);
return ribbon;
}
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Scripts,代码行数:6,代码来源:CustomO2.cs
示例5: OnMouseUp
private void OnMouseUp(object sender, Forms.MouseEventArgs e)
{
if (e.Button == Forms.MouseButtons.Right)
{
ShowContextMenu();
}
OnRaiseEvent(MouseUpEvent, new MouseButtonEventArgs(
InputManager.Current.PrimaryMouseDevice, 0, ToMouseButton(e.Button)));
}
开发者ID:salerth,项目名称:teambuildtray,代码行数:9,代码来源:NotifyIcon.cs
示例6: KeyToUnicode
/// <remarks>Only works with Windows.Forms.Keys. The WPF Key enum seems to be horribly distorted!</remarks>
public static string KeyToUnicode(WinForms.Keys key)
{
StringBuilder sb = new StringBuilder(256);
IntPtr hkl = GetKeyboardLayout(0);
uint scanCode = MapVirtualKeyEx((uint)key, 0, hkl);
if (scanCode < 1) return null;
ClearKeyboardBuffer(hkl);
int len = ToUnicodeEx((uint)key, scanCode, new byte[256], sb, sb.Capacity, 0, hkl);
if (len > 0)
return sb.ToString(0, len).ToUpper();
ClearKeyboardBuffer(hkl);
return null;
}
开发者ID:Rew,项目名称:SharpDevelop,代码行数:17,代码来源:MenuService.cs
示例7: OnMouseDoubleClick
private void OnMouseDoubleClick(object sender, Forms.MouseEventArgs args) {
RaiseEvent(CreateMouseButtonEventArgs(MouseDoubleClickEvent, args.Button));
}
开发者ID:Rud5G,项目名称:SparkleShare,代码行数:3,代码来源:SparkleNotifyIcon.cs
示例8: Wrap
private static Screen Wrap(WinForms.Screen screen)
{
return screen == null ? null : new Screen(screen);
}
开发者ID:karno,项目名称:StarryEyes,代码行数:4,代码来源:Screen.cs
示例9: trayicon_Click
private void trayicon_Click(object sender, WinForms.MouseEventArgs e)
{
if (e.Button == WinForms.MouseButtons.Left)
{
NotifyCtr.Instance.DisplayNotification(TwitchDataHandler.Instance.CurrentInfo, ConfigMgnr.I.NotificationScreenTime);
}
else if (e.Button == WinForms.MouseButtons.Middle)
{
trayicon_OpenMainWindow(this, EventArgs.Empty);
}
}
开发者ID:MartinHartmannJensen,项目名称:TwitchNotifier,代码行数:11,代码来源:MainWindow.xaml.cs
示例10: directPlayWindow_KeyDown
/// <summary>
/// Responds to key down in hiddenwindow
/// </summary>
//
void directPlayWindow_KeyDown(object sender, WindowsForms.KeyEventArgs e)
{
if (_keyDown != null)
{
_logger.Debug("directPlayWindow_KeyDown {0}", e.KeyCode);
// map from System.Windows.Forms to System.Windows.Input key event
var window = _presenationManager.MainApplicationWindow;
window.Dispatcher.InvokeAsync(() =>
{
var source = (HwndSource)PresentationSource.FromVisual(window);
if (source != null)
{
var key = KeyInterop.KeyFromVirtualKey((int)e.KeyCode);
var keyEventArg = new KeyEventArgs(Keyboard.PrimaryDevice, source, 0, key);
_keyDown.Invoke(null, keyEventArg);
e.Handled = keyEventArg.Handled;
}
});
}
}
开发者ID:TomGillen,项目名称:MBT,代码行数:26,代码来源:UserInputManager.cs
示例11: CreateMouseButtonEventArgs
private static MouseButtonEventArgs CreateMouseButtonEventArgs(RoutedEvent handler, Forms.MouseButtons button) {
MouseButton mouse_button;
if(button == Forms.MouseButtons.Left) {
mouse_button = MouseButton.Left;
} else if(button == Forms.MouseButtons.Right) {
mouse_button = MouseButton.Right;
} else if(button == Forms.MouseButtons.Middle) {
mouse_button = MouseButton.Middle;
} else if(button == Forms.MouseButtons.XButton1) {
mouse_button = MouseButton.XButton1;
} else if(button == Forms.MouseButtons.XButton2) {
mouse_button = MouseButton.XButton2;
} else {
throw new InvalidOperationException();
}
return new MouseButtonEventArgs(InputManager.Current.PrimaryMouseDevice, 0, mouse_button) {
RoutedEvent = handler
};
}
开发者ID:Rud5G,项目名称:SparkleShare,代码行数:26,代码来源:SparkleNotifyIcon.cs
示例12: directPlayWindow_MouseMove
/// <summary>
/// Responds to key down in hiddenwindow
/// </summary>
//
void directPlayWindow_MouseMove(object sender, WindowsForms.MouseEventArgs e)
{
if (_mouseMove != null)
{
//_logger.Debug("directPlayWindow_MouseMove");
// map from System.Windows.Forms to System.Windows.Input mouse move event
var window = _presenationManager.MainApplicationWindow.Dispatcher.InvokeAsync(() =>
{
var mouseEventArgs = new MouseButtonEventArgs(WindowsInput.InputManager.Current.PrimaryMouseDevice,
0,
ConvertMouseButton(e.Button));
if(_mouseMove != null) //experienced an issue when closing the app where _mouseMove went away b/w the test above and when the async exec occured
_mouseMove.Invoke(null, mouseEventArgs);
});
}
}
开发者ID:TomGillen,项目名称:MBT,代码行数:20,代码来源:UserInputManager.cs
示例13: OnMouseUp
private void OnMouseUp(object sender, Forms.MouseEventArgs args) {
if(args.Button == Forms.MouseButtons.Right) {
ContextMenu.IsOpen = true;
ContextMenu.StaysOpen = false;
}
RaiseEvent(CreateMouseButtonEventArgs(MouseUpEvent, args.Button));
}
开发者ID:Rud5G,项目名称:SparkleShare,代码行数:10,代码来源:SparkleNotifyIcon.cs
示例14: Screen
private Screen(WinForms.Screen wfScreen)
{
if (wfScreen == null)
throw new ArgumentNullException("wfScreen");
this.original = wfScreen;
}
开发者ID:hosiminn,项目名称:StarryEyes,代码行数:6,代码来源:Screen.cs
示例15: ConvertMouseButton
private WindowsInput.MouseButton ConvertMouseButton(WindowsForms.MouseButtons button)
{
switch (button)
{
case WindowsForms.MouseButtons.Left:
return WindowsInput.MouseButton.Left;
case WindowsForms.MouseButtons.Right:
return WindowsInput.MouseButton.Right;
case WindowsForms.MouseButtons.Middle:
return WindowsInput.MouseButton.Middle;
case WindowsForms.MouseButtons.XButton1:
return WindowsInput.MouseButton.XButton1;
case WindowsForms.MouseButtons.XButton2:
return WindowsInput.MouseButton.XButton2;
// can't map none & can't access MouseButtonEventArgs.ButtonState
// todo - use reflection to set button sate, join new MouseButtonEventArgs call & and this method
case WindowsForms.MouseButtons.None:
return WindowsInput.MouseButton.XButton2;
}
throw new InvalidOperationException();
}
开发者ID:TomGillen,项目名称:MBT,代码行数:21,代码来源:UserInputManager.cs
示例16: ToMouseButton
private MouseButton ToMouseButton(Forms.MouseButtons button)
{
switch (button)
{
case Forms.MouseButtons.Left:
return MouseButton.Left;
case Forms.MouseButtons.Right:
return MouseButton.Right;
case Forms.MouseButtons.Middle:
return MouseButton.Middle;
case Forms.MouseButtons.XButton1:
return MouseButton.XButton1;
case Forms.MouseButtons.XButton2:
return MouseButton.XButton2;
}
throw new InvalidOperationException();
}
开发者ID:AndyAn,项目名称:Miiror,代码行数:17,代码来源:NotificationAreaIcon.cs
示例17: OnMouseUp
private void OnMouseUp(object sender, Forms.MouseEventArgs e)
{
OnRaiseEvent(MouseUpEvent, new MouseButtonEventArgs(
InputManager.Current.PrimaryMouseDevice, 0, ToMouseButton(e.Button)));
}
开发者ID:AndyAn,项目名称:Miiror,代码行数:5,代码来源:NotificationAreaIcon.cs
示例18: WinFormsMouseEventArgs
public WinFormsMouseEventArgs(WinForms.MouseEventArgs e)
{
this.eventArgs = e;
}
开发者ID:Kei-Nanigashi,项目名称:StarryEyes,代码行数:4,代码来源:WinFormsMouseEventArgs.cs
示例19: OnMouseMove
private void OnMouseMove(object sender, Forms.MouseEventArgs e)
{
OnRaiseEvent(MouseMoveEvent, new MouseButtonEventArgs(
InputManager.Current.PrimaryMouseDevice, 0, MouseButton.Left));
}
开发者ID:salerth,项目名称:teambuildtray,代码行数:5,代码来源:NotifyIcon.cs
示例20: ComboBoxProvider
public ComboBoxProvider (SWF.ComboBox combobox) : base (combobox)
{
comboboxControl = combobox;
comboboxControl.DropDownStyleChanged += OnDropDownStyleChanged;
listboxProvider = new ComboBoxProvider.ComboBoxListBoxProvider (comboboxControl,
this);
}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:ComboBoxProvider.cs
注:本文中的System.Windows.Forms类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论