当前位置: 首页>>代码示例>>C#>>正文


C# Windows.Forms类代码示例

本文整理汇总了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);
 }
开发者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: 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

示例12: MenuItemProvider

		public MenuItemProvider (SWF.MenuItem menuItem) :
			base (menuItem)
		{
			this.menuItem = menuItem;
			parentMenu = mainMenu =	menuItem.GetMainMenu ();
			if (parentMenu == null)
				parentMenu = menuItem.GetContextMenu ();
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:MenuItemProvider.cs

示例13: ListViewProvider

		public ListViewProvider (SWF.ListView listView) : base (listView)
		{
			this.listView = listView;

			lastView = listView.View;
			showGroups = listView.ShowGroups;
			groups = new Dictionary<SWF.ListViewGroup, ListViewGroupProvider> ();
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:ListViewProvider.cs

示例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";
     }
 }
开发者ID:TiCK3R,项目名称:SharpLeech,代码行数:14,代码来源:ManualLoginWindow.xaml.cs

示例15: OnPaintBackground

 protected override void OnPaintBackground(SWF.PaintEventArgs e)
 {
 }
开发者ID:tomba,项目名称:dwarrowdelf,代码行数:3,代码来源:SharpDXHost.cs


注:本文中的System.Windows.Forms类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。