protected override void OnCellMouseClick(DataGridViewCellMouseEventArgs e) { base.OnCellMouseClick(e); if (e.ColumnIndex >= this.ColumnHeaderCount && e.RowIndex >= 0) { var tsDay = this.Rows[e.RowIndex].Cells[e.ColumnIndex].Value as TimeSheetDay; if (tsDay != null) { // show tool tip if (e.Button == System.Windows.Forms.MouseButtons.Left && !popupToolTip.Visible) { // Only show tooltip when the mouse is in topright corner of cell Rectangle rect = this.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true); if (rect.CheckPointInCorner(e.X, e.Y, this.PositionShowToolTip)) { commentToolTip.Title = tsDay.GetTitle(); commentToolTip.Content = tsDay.GetContent(); popupToolTip.Show(this, rect); } } // ToolTip } // Check CellValue is not null } }
public void Initialize() { if (LoadTime == new DateTime(1900, 1, 1)) { try { Conx.Open(); Conx.Close(); } catch (Exception) { if (Conx.State == ConnectionState.Open) { Conx.Close(); } MessageBox.Show("Fallo Conexion a la Base de Datos", "Base de Datos", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } BD = Conx.Database; Loader = new BackgroundWorker(); Loader.WorkerReportsProgress = true; Loader.WorkerSupportsCancellation = true; Loader.ProgressChanged += Loader_ProgressChanged; Loader.RunWorkerCompleted += Loader_RunWorkerCompleted; Loader.DoWork += Loader_DoWork; //Inicio de Carga ISenseRect = new PopupControl.Popup(LoadDialog = new LoadingInfo()); ISenseRect.AutoClose = false; ISenseRect.FocusOnOpen = false; ISenseRect.Opacity = 0.65; ISenseRect.ShowingAnimation = PopupControl.PopupAnimations.TopToBottom | PopupControl.PopupAnimations.Slide; ISenseRect.HidingAnimation = PopupControl.PopupAnimations.Blend; ISenseRect.AnimationDuration = 100; LoadDialog.SetInfo(BD, "Abriendo Conexion a BD"); ISenseRect.Show(new System.Drawing.Point(200, 200)); Loader.RunWorkerAsync(); } }
internal void Initialize(Point Location, bool FullLoad = false) { try { Connection.Open(); Connection.Close(); } catch (Exception ex) { if (Connection.State == ConnectionState.Open) Connection.Close(); MessageBox.Show("Error on database connection: " + ex.Message, "Database connection", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Loader = new BackgroundWorker(); Loader.WorkerReportsProgress = true; Loader.WorkerSupportsCancellation = true; Loader.ProgressChanged += Loader_ProgressChanged; if (!FullLoad) { Loader.DoWork += Loader_DoWork; Loader.RunWorkerCompleted += Loader_RunWorkerCompleted; } else { Loader.DoWork += Loader_DoWork2; Loader.RunWorkerCompleted += Loader_RunWorkerCompleted2; } //Inicio de Carga ISenseRect = new PopupControl.Popup(LoadDialog = new LoadingInfo()); ISenseRect.AutoClose = false; ISenseRect.FocusOnOpen = false; ISenseRect.Opacity = 0.65; ISenseRect.ShowingAnimation = PopupControl.PopupAnimations.TopToBottom | PopupControl.PopupAnimations.Slide; ISenseRect.HidingAnimation = PopupControl.PopupAnimations.Blend; ISenseRect.AnimationDuration = 100; LoadDialog.SetInfo(this.Server, "Connecting to database..."); ISenseRect.Show(Location); Loader.RunWorkerAsync(); }