void breadCrumbLabel_Click(object sender, EventArgs e) { var arrow = breadCrumbToolStrip.Items[breadCrumbToolStrip.Items.IndexOf(sender as ToolStripStatusLabel) - 1]; if (_subItemPopup != null && _subItemPopup.Tag == ((ToolStripStatusLabel) sender).Tag) { _subItemPopup.Tag = null; _subItemPopup.Close(); } else if (((ToolStripStatusLabel) sender).Tag is DataFilter) { breadCrumbToolStrip.Items[breadCrumbToolStrip.Items.IndexOf(sender as ToolStripStatusLabel) - 1].Text = "v"; var ContainerBox = CreateContainerBox(breadCrumbToolStrip.Items[breadCrumbToolStrip.Items.IndexOf((ToolStripStatusLabel)sender)+1].Tag as BreadCrumb); _subItemPopup = new Popup(ContainerBox) { AutoSize = true, Size = _tableSize, AutoClose = true, FocusOnOpen = true, Tag = (sender as ToolStripStatusLabel).Tag }; _subItemPopup.Closed += delegate { breadCrumbToolStrip.Items[ breadCrumbToolStrip.Items.IndexOf(sender as ToolStripStatusLabel) - 1 ].Text = ">"; _subItemPopup.Tag = null; }; _subItemPopup.Show(PointToScreen(new Point(arrow.Bounds.Left, arrow.Bounds.Bottom))); } }
private void formLogin_Shown(object sender, EventArgs e) { try { string[] directorys = System.IO.Directory.GetDirectories(AppDomain.CurrentDomain.BaseDirectory + "data\\"); string[] rDirectorys = new string[directorys.Length]; int j = 0; for (int i = 0; i < directorys.Length; i++) { var time = DateTime.Now.AddDays(-1); var path = directorys[i] + "\\usrCookie.cfg"; if (System.IO.File.Exists(path)) { time = System.IO.File.GetLastWriteTime(path); if (DateTime.Now.Subtract(time).TotalMinutes > 30) { System.IO.File.Delete(path); } else { rDirectorys[j++] = directorys[i].Substring(directorys[i].LastIndexOf("\\")).Replace("\\", ""); } } } if (rDirectorys[0] != null) { var ql = new QuicklyLogin(); ql.Buttons = rDirectorys; var popup = new Popup(ql) { AutoClose = true, FocusOnOpen = false, ShowingAnimation = PopupAnimations.Slide | PopupAnimations.LeftToRight, HidingAnimation = PopupAnimations.Slide | PopupAnimations.RightToLeft }; popup.Closing += popup_Closing; popup.Show(new Point(this.Location.X + this.Width + 3, this.Location.Y + 3)); } } catch (Exception) { } finally { } GetRandCodeImg(); }
private void 显示过站信息ToolStripMenuItem_Click(object sender, EventArgs e) { //dgvQuickTrainInfo.DataSource = null; if (dgvTrainView.SelectedRows.Count > 0) { Rectangle rect = dgvTrainView.GetCellDisplayRectangle(1, dgvTrainView.SelectedRows[0].Cells[0].RowIndex, true); var data = dgvTrainView.SelectedRows[0].DataBoundItem as QueryLeftNewDTO; pop = new Popup(new TrainDeatils(cookieContainer, String.Format("{0} : {1} - {2}", data.Station_train_code, data.From_station_name, data.To_station_name), data.From_station_name, data.To_station_name, data.Train_no, data.From_station_telecode, data.To_station_telecode, dtpRiqi.Value.ToString("yyyy-MM-dd"))); pop.AutoClose = true; pop.FocusOnOpen = true; pop.ShowingAnimation = PopupAnimations.TopToBottom | PopupAnimations.Slide; pop.HidingAnimation = PopupAnimations.BottomToTop | PopupAnimations.Slide; pop.Show(dgvTrainView, rect); } }
private void btnAutoSubmitSet_Click(object sender, EventArgs e) { pop = new Popup(new ControlPassengers(_passengersData, _QuickPassengers)); pop.AutoClose = false; pop.ShowingAnimation = pop.HidingAnimation = PopupAnimations.Blend; pop.Show(formSelectTicket.FormThis.Location.X + formSelectTicket.FormThis.Width / 2 - pop.Width / 2, formSelectTicket.FormThis.Location.X + formSelectTicket.FormThis.Height / 2 - pop.Height / 2); pop.Closed += (ss, ee) => { GetPassengers(); UpdateAutoPassengersList(); }; }
private void notifyTimer_Elapsed(object sender, ElapsedEventArgs e) { // notifyForm = new NotifyForm(this.notifyIcon.Text); // notifyForm.ShowNoActivate(); // notifyForm.Closed += new EventHandler(notifyForm_Closed); notifyForm = new NotifyForm(this.notifyIcon.Text); int screenWidth = Screen.PrimaryScreen.WorkingArea.Width; int screenHeight = Screen.PrimaryScreen.WorkingArea.Height; int clientWidth = notifyForm.Width; int clientHeight = notifyForm.Height; Rectangle area = new Rectangle(screenWidth - clientWidth, screenHeight - clientHeight, clientWidth, clientHeight); popup = new Popup(this.notifyForm); popup.Top = screenHeight - clientHeight; popup.Left = screenWidth - clientWidth; popup.Closed += new ToolStripDropDownClosedEventHandler(notifyPopup_Closed); notifyForm.Prepare(); popup.Show(new Point(screenWidth - clientWidth, screenHeight - clientHeight)); }