本文整理汇总了C#中System.Windows.Forms类的典型用法代码示例。如果您正苦于以下问题:C# Forms类的具体用法?C# Forms怎么用?C# Forms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Forms类属于System.Windows命名空间,在下文中一共展示了Forms类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Wrap
private static Screen Wrap(WinForms.Screen screen)
{
if (screen == null)
return null;
else
return new Screen(screen);
}
示例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\"));
}
示例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);
}
}
示例4: create
public static WPF_Ribbon create(WinForms.Control control, string title)
{
var ribbon = control.add_Ribbon_WithLogViewer(title);
ribbon.title(title);
return ribbon;
}
示例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)));
}
示例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;
}
示例7: OnMouseDoubleClick
private void OnMouseDoubleClick(object sender, Forms.MouseEventArgs args) {
RaiseEvent(CreateMouseButtonEventArgs(MouseDoubleClickEvent, args.Button));
}
示例8: Wrap
private static Screen Wrap(WinForms.Screen screen)
{
return screen == null ? null : new Screen(screen);
}
示例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);
}
}
示例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;
}
});
}
}
示例11: ComboBoxProvider
public ComboBoxProvider (SWF.ComboBox combobox) : base (combobox)
{
comboboxControl = combobox;
comboboxControl.DropDownStyleChanged += OnDropDownStyleChanged;
listboxProvider = new ComboBoxProvider.ComboBoxListBoxProvider (comboboxControl,
this);
}
示例12: MenuItemProvider
public MenuItemProvider (SWF.MenuItem menuItem) :
base (menuItem)
{
this.menuItem = menuItem;
parentMenu = mainMenu = menuItem.GetMainMenu ();
if (parentMenu == null)
parentMenu = menuItem.GetContextMenu ();
}
示例13: ListViewProvider
public ListViewProvider (SWF.ListView listView) : base (listView)
{
this.listView = listView;
lastView = listView.View;
showGroups = listView.ShowGroups;
groups = new Dictionary<SWF.ListViewGroup, ListViewGroupProvider> ();
}
示例14: wbLogin_ProgressChanged
private void wbLogin_ProgressChanged(object sender, wf.WebBrowserProgressChangedEventArgs e)
{
if (e.CurrentProgress < e.MaximumProgress)
{
this.Title = string.Format(
"Manual Login [{0:N}%]",
(double)e.CurrentProgress / ((double)e.MaximumProgress / 100)
);
}
else
{
this.Title = "Manual Login";
}
}
示例15: OnPaintBackground
protected override void OnPaintBackground(SWF.PaintEventArgs e)
{
}