本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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
}
示例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);
}
}
示例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;
}
示例7: GetKeyFor
private static string GetKeyFor(Form form, Control control){
return string.Format("{0}_{1}", form.GetHashCode(), control.GetHashCode());
}
示例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);
}