/// <summary> /// Function to resize the heigh of this WinForm based on the number of itmes in the lists /// </summary> private void resizeForm() { var listViewItemsCount = listView.Items.Count; if (listViewItemsCount > 0) { this.Height = (listViewItemsCount * listView.Items[0].Bounds.Height) + (listView.Groups.Count * listView.GetItemRect(0).Height) + ((listView.Items.Count) + 100); } Region = System.Drawing.Region.FromHrgn(Win32Hooks.CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); linkLabelGitHub.Top = listView.Top + listView.Height + 5; }
static void Main() { // Set logger Dapplo.Log.LogSettings.RegisterDefaultLogger <NLogLogger>(Dapplo.Log.LogLevels.Verbose); // check if a settings file has been provided in command line // otherwise app will use default values. var commandLineArgs = Environment.GetCommandLineArgs(); SettingsFileName = commandLineArgs.Length > 1 ? commandLineArgs[1] : ""; // _hookID = SetHook(_proc); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mf = new MainForm(); Application.Run(mf); Win32Hooks.UnhookWindowsHookEx(_hookID); }