private void MainForm_SizeChanged(object sender, EventArgs e) { if (WindowState.Equals(FormWindowState.Maximized)) { listView_SizeChanged(expenses_listView, null); } }
//protected override CreateParams CreateParams //{ // get // { // CreateParams cp = base.CreateParams; // cp.ExStyle |= 0x02000000; // return cp; // } //} private void TitleLabelClick(object sender, EventArgs e) { if (CloseLabel.Equals(sender)) { Close(); //SendDataTest(LANAllComputerIp.ComputerStatus.BREAK_LIEN); } else { if (MaxOrMinLabel.Equals(sender)) { if (WindowState.Equals(FormWindowState.Normal)) { WindowState = FormWindowState.Maximized; } else if (WindowState.Equals(FormWindowState.Maximized)) { WindowState = FormWindowState.Normal; } } else { WindowState = FormWindowState.Minimized; } } }
void TimerTick(object sender, EventArgs e) { if (FormBorderStyle.Equals(FormBorderStyle.Sizable) && WindowState.Equals(FormWindowState.Minimized) == false) { WindowState = FormWindowState.Minimized; Visible = false; ShowIcon = false; notifyIcon.Visible = true; } else if (Visible == false && ShowIcon == false && notifyIcon.Visible && WindowState.Equals(FormWindowState.Minimized)) { var now = DateTime.Now; var sat = Base.CheckIfMarketDelay(now); now = now.DayOfWeek switch { DayOfWeek.Sunday => now.AddDays(1), DayOfWeek.Saturday => now.AddDays(2), DayOfWeek weeks when weeks.Equals(DayOfWeek.Friday) && now.Hour > (sat ? 9 : 8) => now.AddDays(3), _ => now.Hour > (sat ? 9 : 8) || Array.Exists(Base.Holidays, o => o.Equals(now.ToString(Base.DateFormat))) ? now.AddDays(1) : now, }; sat = Base.CheckIfMarketDelay(now); var remain = new DateTime(now.Year, now.Month, now.Day, sat ? 0xA : 9, 0, 0) - DateTime.Now; notifyIcon.Text = Base.GetRemainingTime(remain); if (API is null && Base.IsDebug is false && remain.TotalMinutes < 0x29 && now.Hour == (sat ? 9 : 8)) { API = new ConnectAPI(args); timer.Interval = 0x3A99; } else if (API is null && Base.IsDebug) { API = new ConnectAPI(administrator); timer.Interval = 0x3A99; }
protected override void OnStateChanged(EventArgs e) { base.OnStateChanged(e); if (WindowState.Equals(WindowState.Maximized)) { _appSettings.SidebarMode = false; } else { if (WindowState.Equals(WindowState.Minimized)) { return; } _appSettings.SidebarMode = _sidebarModeBeforeMaximize; if (_appSettings.SidebarMode) { TurnOnSidebarMode(); } else { TurnOffSidebarMode(); } SetWindowPlacement(true, false); } }
private void panel3_DoubleClick(object sender, EventArgs e) { WindowState = WindowState == FormWindowState.Maximized ? FormWindowState.Normal : FormWindowState.Maximized; Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, Width - 0, Height - 0, 7, 7)); Settings.Default.max = WindowState.Equals(FormWindowState.Maximized); Settings.Default.Save(); }
private void WindowActivated(object sender, EventArgs e) { if (WindowState.Equals(WindowState.Normal)) { videoImageControl.Start(); } }
private void MainWindow_OnSizeChanged(object sender, SizeChangedEventArgs e) { if (WindowState.Equals(WindowState.Normal)) { _size = e.NewSize; } }
private void WindowDeactivated(object sender, EventArgs e) { if (WindowState.Equals(WindowState.Minimized)) { videoImageControl.Stop(); } }
void TimerTick(object sender, EventArgs e) { if (FormBorderStyle.Equals(FormBorderStyle.Sizable) && WindowState.Equals(FormWindowState.Minimized) == false && Result.Equals(DialogResult.Yes)) { FormBorderStyle = FormBorderStyle.FixedSingle; WindowState = FormWindowState.Minimized; } else if (DateTime.Now.Hour < 3 && backgroundWorker.IsBusy == false && DateTime.Now.DayOfWeek.Equals(DayOfWeek.Sunday) && (cookie as string).Equals(admin) == false) { timer.Stop(); strip.ItemClicked -= OnItemClick; GetSettleTheFare(); Dispose(); } else if (Visible == false && ShowIcon == false && notifyIcon.Visible && WindowState.Equals(FormWindowState.Minimized)) { notifyIcon.Icon = (Icon)resources.GetObject(Change ? upload : download); Change = !Change; if (IsApplicationAlreadyRunning(Privacy.Security) == false && backgroundWorker.IsBusy == false && string.IsNullOrEmpty(Privacy.Account) && string.IsNullOrEmpty(Privacy.SecuritiesAPI) && string.IsNullOrEmpty(Privacy.SecurityAPI)) { strip.Items.Find(st, false).First(o => o.Name.Equals(st)).PerformClick(); } } else { Statistical.CheckForSurvival(colors[DateTime.Now.Second % 3]); } }
private void doLogin() { if (!loaded) { return; } // TODO clear session vars enVars.successLogin = false; if (WindowState.Equals(FormWindowState.Minimized)) { return; } // 'If Application.OpenForms().OfType(Of SplashScreen).Any Then // 'Exit Sub // 'End If // 'Me.Hide() // ' If splashScreenLogin.ShowDialog() = DialogResult.OK Then // 'Me.Show() // 'Else // 'Application.Exit() // 'Close() // 'End If }
private void WindowDeactivated(object sender, EventArgs e) { // Stop rendering when minimized if (WindowState.Equals(WindowState.Minimized)) { videoImageControl.Stop(false); // Passing false, true would stop visualization on tracker level } }
private void WindowActivated(object sender, EventArgs e) { // Rendering video when active/visible if (WindowState.Equals(WindowState.Normal)) { videoImageControl.Start(); } }
private void GoblinBatResize(object sender, EventArgs e) { if (WindowState.Equals(FormWindowState.Minimized)) { Visible = false; ShowIcon = false; notifyIcon.Visible = true; } }
private void Window1_Deactivated(object sender, EventArgs e) { if (WindowState.Equals(WindowState.Minimized)) { videoImageControl.Stop(true); } videoImageControl.VideoOverlayTopMost = false; }
private void Window1_Deactivated(object sender, EventArgs e) { lblTitle.FontSize = GazeTrackerUIMainWindow.FontSize; if (WindowState.Equals(WindowState.Minimized)) { videoImageControl.Stop(true); } videoImageControl.VideoOverlayTopMost = false; }
//modified for testing purpose public bool check_minimize(string n) { WindowState = FormWindowState.Minimized; if (WindowState.Equals(n)) { return(true); } return(false); }
private void mnuMain_Resize(object sender, EventArgs e) { if (!WindowState.Equals(FormWindowState.Minimized)) { return; } Hide(); _notifyIcon.Visible = true; _notifyIcon.ShowBalloonTip(3000); }
private void ChangeStateButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (WindowState.Equals(WindowState.Normal)) { WindowState = WindowState.Maximized; } else { WindowState = WindowState.Normal; } }
private void max_Click(object sender, EventArgs e) { if (WindowState.Equals(FormWindowState.Maximized)) { WindowState = FormWindowState.Normal; } else { WindowState = FormWindowState.Maximized; } }
// Resizes the form private void guna2Button2_Click(object sender, EventArgs e) { if (WindowState.Equals(FormWindowState.Normal)) { WindowState = FormWindowState.Maximized; } else if (WindowState.Equals(FormWindowState.Maximized)) { WindowState = FormWindowState.Normal; } }
private void btnMaximizar_Click(object sender, EventArgs e) { //this.StartPosition = FormStartPosition.CenterScreen; if (WindowState.Equals(FormWindowState.Normal)) { WindowState = FormWindowState.Maximized; } else { WindowState = FormWindowState.Normal; } }
/// <summary> /// Resize /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void Button_Click_Resize(object sender, RoutedEventArgs e) { if (WindowState.Equals(WindowState.Normal)) { WindowState = WindowState.Maximized; resizeButton.Content = ">"; } else { WindowState = WindowState.Normal; resizeButton.Content = "<"; } }
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg == 562) // WM_EXITSIZEMOVE after window move / size changed { SetToggleButton(); if (!WindowState.Equals(WindowState.Maximized)) { SaveWindowsPlacement(); } } return(IntPtr.Zero); }
protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); if (WindowState.Equals(FormWindowState.Minimized) && Properties.Settings.Default.MinimizeToTray) { Hide(); if (Properties.Settings.Default.FirstTimeTray != false) { NotifyArea.ShowStatusTray(Languages.Parse("Information"), Languages.Parse("MinimizedToTray"), ToolTipIcon.Info); Properties.Settings.Default.FirstTimeTray = false; Properties.Settings.Default.Save(); } } }
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e) { if (e.RightButton.Equals(MouseButtonState.Pressed)) { return; } if (e.LeftButton.Equals(MouseButtonState.Pressed) && e.ClickCount.Equals(2)) { WindowState = WindowState.Equals(WindowState.Maximized) ? WindowState.Normal : WindowState.Maximized; return; } this.Cursor = Cursors.ScrollAll; this.DragMove(); this.Cursor = Cursors.Arrow; }
protected void FullScreenMode() { Topmost = true; ResizeMode = ResizeMode.CanMinimize; WindowStyle = WindowStyle.None; if (WindowState.Equals(WindowState.Maximized)) { // Needed for maximized windows SystemCommands.RestoreWindow(this); WasMaximized = true; } else { WasMaximized = false; } SystemCommands.MaximizeWindow(this); }
/// <summary> /// Gets triggered when the main window is maximized. If our windows are hidden, sets the to visible /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainWindow_StateChanged(object sender, EventArgs e) { if (WindowState.Equals(WindowState.Maximized)) { foreach (ProgramWindow ourWindow in WindowList) { if (ourWindow.Visible == false && !_selectWindowActivated) { ourWindow.Show(); } } } else if (WindowState.Equals(WindowState.Minimized)) { // Do Stuff Here } }
void GoblinBatResize(object sender, EventArgs e) { if (WindowState.Equals(FormWindowState.Minimized)) { if (string.IsNullOrEmpty(OnClickMinimized) == false && OnClickMinimized.Equals(st)) { Statistical.Hide(); } Opacity = 0.8135; BackColor = Color.FromArgb(0x79, 0x85, 0x82); Visible = false; ShowIcon = false; ClosingForm = false; notifyIcon.Visible = true; } }
/// <summary> /// Sets the window to fullscreen according to the position of the taskbar and back to normal. /// </summary> private void SetFullscreenWindow() { if (winState.Equals(WindowState.Normal)) { // Checking which side the taskbar is on. if (SystemParameters.WorkArea.Left > 0) { mWindow.Top = 0; mWindow.Left = SystemParameters.PrimaryScreenWidth - SystemParameters.WorkArea.Width; } else if (SystemParameters.WorkArea.Top > 0) { mWindow.Top = SystemParameters.PrimaryScreenHeight - SystemParameters.WorkArea.Height; mWindow.Left = 0; } else if (SystemParameters.WorkArea.Left == 0 && SystemParameters.WorkArea.Width < SystemParameters.PrimaryScreenWidth) { mWindow.Top = SystemParameters.PrimaryScreenHeight - SystemParameters.WorkArea.Height; mWindow.Left = 0; } else { mWindow.Top = 0; mWindow.Left = 0; } winState = WindowState.Maximized; WindowWidth = SystemParameters.WorkArea.Width; WindowHeight = SystemParameters.WorkArea.Height; } else { // Set window back to normal size. winState = WindowState.Normal; WindowWidth = SystemParameters.PrimaryScreenWidth * 0.65; WindowHeight = SystemParameters.PrimaryScreenHeight * 0.65; mWindow.Left = (SystemParameters.PrimaryScreenWidth - WindowWidth) / 2; mWindow.Top = (SystemParameters.PrimaryScreenHeight - WindowHeight) / 2; } }
private void StartUpResize(object sender, EventArgs e) { BeginInvoke(new Action(() => { if (WindowState.Equals(FormWindowState.Minimized)) { switch (OnClickMinimized) { case "quotes": API.SendQuotes -= Quotes.OnReceiveQuotes; API.SendState -= Quotes.OnReceiveState; API.SendTrend -= Quotes.OnReceiveTrend; Quotes.Hide(); break; case "account": API.SendDeposit -= Account.OnReceiveDeposit; Account.Hide(); break; case "balance": API.SendCurrent -= Balance.OnRealTimeCurrentPriceReflect; API.SendBalance -= Balance.OnReceiveBalance; Balance.SendReSize -= OnReceiveSize; Balance.Hide(); break; case "strategy": Statistical.Hide(); break; } ; Visible = false; ShowIcon = false; notifyIcon.Visible = true; } })); }