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


C# Form.GetHashCode方法代码示例

本文整理汇总了C#中System.Windows.Forms.Form.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Form.GetHashCode方法的具体用法?C# Form.GetHashCode怎么用?C# Form.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Form的用法示例。


在下文中一共展示了Form.GetHashCode方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterHotKey

 public static void RegisterHotKey(Form f, Keys key)
 {
     int modifiers = 0;
     if ((key & Keys.Alt) == Keys.Alt)
         modifiers = modifiers | MOD_ALT;
     if ((key & Keys.Control) == Keys.Control)
         modifiers = modifiers | MOD_CONTROL;
     if ((key & Keys.Shift) == Keys.Shift)
         modifiers = modifiers | MOD_SHIFT;
     Keys k = key & ~Keys.Control & ~Keys.Shift & ~Keys.Alt;
     keyId = f.GetHashCode(); // this should be a key unique ID, modify this if you want more than one hotkey
     RegisterHotKey(f.Handle, keyId, (uint)modifiers, (uint)k);
 }
开发者ID:henderea,项目名称:PopupMultibox,代码行数:13,代码来源:Utilities.cs

示例2: RegisterHotKey

        public static void RegisterHotKey(Form f, int hotkey, bool ctrl, bool alt, bool shift, bool launcher)
        {
            int modifiers = 0;

            if (ctrl)
                modifiers = modifiers | MOD_CONTROL;
            if (alt)
                modifiers = modifiers | MOD_ALT;
            if (shift)
                modifiers = modifiers | MOD_SHIFT;

            if (!launcher)
            {
                keyId = f.GetHashCode();
                RegisterHotKey((IntPtr)f.Handle, keyId, modifiers, hotkey);
            }
            else
            {
                launcherKeyId = f.GetHashCode() + 1;
                RegisterHotKey((IntPtr)f.Handle, launcherKeyId, modifiers, hotkey);
            }
        }
开发者ID:Winterstark,项目名称:Adjutant,代码行数:22,代码来源:classHotkey.cs

示例3: RegisterHotKey

        public static void RegisterHotKey(Form f, Keys key)
        {
            var modifiers = 0;

            if ((key & Keys.Alt) == Keys.Alt)
                modifiers = modifiers | ModAlt;

            if ((key & Keys.Control) == Keys.Control)
                modifiers = modifiers | ModControl;

            if ((key & Keys.Shift) == Keys.Shift)
                modifiers = modifiers | ModShift;

            var k = key & ~Keys.Control & ~Keys.Shift & ~Keys.Alt;
            _keyId = f.GetHashCode(); // this should be a key unique ID, modify this if you want more than one hotkey
            RegisterHotKey(f.Handle, _keyId, modifiers, (int) k);
        }
开发者ID:foliveira,项目名称:life-logging,代码行数:17,代码来源:WindowsShell.cs

示例4: RegisterHotKey

        public static void RegisterHotKey(Form f, Keys key)
        {
            int modifiers = 0;

            if ((key & Keys.Alt) == Keys.Alt)
                modifiers = modifiers | WindowsShell.MOD_ALT;

            if ((key & Keys.Control) == Keys.Control)
                modifiers = modifiers | WindowsShell.MOD_CONTROL;

            if ((key & Keys.Shift) == Keys.Shift)
                modifiers = modifiers | WindowsShell.MOD_SHIFT;

            Keys k = key & ~Keys.Control & ~Keys.Shift & ~Keys.Alt;

            Func ff = delegate()
                {
                    keyId = f.GetHashCode(); // this should be a key unique ID, modify this if you want more than one hotkey
                    RegisterHotKey((IntPtr)f.Handle, keyId, modifiers, (int)k);
                };

            f.Invoke(ff); // this should be checked if we really need it (InvokeRequired), but it's faster this way
        }
开发者ID:RokKos,项目名称:ISS,代码行数:23,代码来源:WindowsShell.cs

示例5: Register

        public static void Register(Form form, AppBarEdge edge, Screen screen)
        {
            Rectangle screenArea = screen.WorkingArea;
            if (edge == AppBarEdge.Top || edge == AppBarEdge.Bottom)
            {
                form.Left = screenArea.Left;
                form.Width = screenArea.Width;
                form.Top = edge == AppBarEdge.Top ? screenArea.Top : screenArea.Bottom - form.Height;
            }
            else
            {
                form.Left = edge == AppBarEdge.Left ? screenArea.Left : screenArea.Right - form.Width;
                form.Height = screenArea.Height;
                form.Top = screenArea.Top;
            }
            form.FormBorderStyle = FormBorderStyle.None;
            uint callbackId = RegisterWindowMessage(form.GetHashCode().ToString("x"));

            APPBARDATA appData = new APPBARDATA();
            appData.cbSize = (uint)Marshal.SizeOf(appData);
            appData.uCallbackMessage = callbackId;
            appData.hWnd = form.Handle;

            uint ret = SHAppBarMessage(AppBarMessage.New, ref appData);
            if (ret != 0)
            {
                _appBars.Add(form);
                form.FormClosing += (s, e) => Unregister(form);
                AppBarPosition(form, edge, AppBarMessage.QueryPos);
                AppBarPosition(form, edge, AppBarMessage.SetPos);
            }
        }
开发者ID:bsandru,项目名称:tasksharp,代码行数:32,代码来源:AppBar.cs

示例6: CreateDockingPane_

 /// <summary>
 /// Add new form as docking pane
 /// </summary>
 /// <param name="NewObject">Form to add</param>
 private Pane CreateDockingPane_(Form NewObject)
 {
     Pane RetVal;
       lock (DockingQueue_)
       {
     DockingQueue_.Add(NewObject.GetHashCode(), NewObject);
     RetVal = axDockingPane.CreatePane(NewObject.GetHashCode(), 200, 120, DockingDirection.DockLeftOf, null);
     RetVal.Title = NewObject.Text;
       }
       return RetVal;
 }
开发者ID:alexshemesh,项目名称:ManagmentApp,代码行数:15,代码来源:MainWindow.cs

示例7: GetKeyFor

 private static string GetKeyFor(Form form, Control control){
     return string.Format("{0}_{1}", form.GetHashCode(), control.GetHashCode());
 }
开发者ID:satr,项目名称:rvslite,代码行数:3,代码来源:ControlCallback.cs

示例8: ReleaseResources

 /// <summary>
 /// When the form dies the TabControls should be released
 /// </summary>
 /// <param name="form">The Form</param>
 public static void ReleaseResources(Form form)
 {
     int code = form.GetHashCode();
     List<TabControl> tabs = FormsWithTabsControlsUsingMnemonic[code];
     foreach (TabControl tab in tabs)
     {
         int tabcode = tab.GetHashCode();
         TabsDisabled.Remove(tabcode);
         TabsVisible.Remove(tabcode);
         ControlOfCustomDrawingMode.Remove(tabcode);
         newProperties.Remove(tabcode);
     }
     FormsWithTabsControlsUsingMnemonic.Remove(code);
 }
开发者ID:WebMAPTestUser,项目名称:SKS,代码行数:18,代码来源:SSTabHelper.cs


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