private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { try { if (e.SelectedControl != gridControl1) { return; } GridHitInfo gridhitinfo = gridView1.CalcHitInfo(e.ControlMousePosition); object o = gridhitinfo.HitTest.ToString(); string text = gridhitinfo.HitTest.ToString(); e.Info = new DevExpress.Utils.ToolTipControlInfo(o, text); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { if (e.SelectedControl == grid_masalar) { TileViewHitInfo hi = tv_masalar.CalcHitInfo(e.ControlMousePosition); if (hi.HitTest == DevExpress.XtraEditors.TileControlHitTest.Item) { foreach (TileViewElementInfo elemInfo in hi.ItemInfo.Elements) { string val = ""; decimal top_tutar = 0, odenen = 0; if (tv_masalar.GetDataRow(hi.RowHandle)["adisyon_id"].ToString() != "0") { DataTable dt_adisyon_kalem = SQL.get("SELECT ak.adisyon_kalem_id, u.urun_adi, ak.miktar, ak.ikram_miktar, tutar = (ak.miktar - ak.ikram_miktar) * u.fiyat, olcu_birimi = p.deger, ak.durum_parametre_id, durum = dr.deger FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id INNER JOIN parametreler p ON p.parametre_id = u.olcu_birimi_parametre_id INNER JOIN parametreler dr ON dr.parametre_id = ak.durum_parametre_id WHERE ak.silindi = 0 AND ak.adisyon_id = " + tv_masalar.GetDataRow(hi.RowHandle)["adisyon_id"]); for (int i = 0; i < dt_adisyon_kalem.Rows.Count; i++) { val += dt_adisyon_kalem.Rows[i]["urun_adi"].ToString() + " x " + Convert.ToDecimal(dt_adisyon_kalem.Rows[i]["miktar"]).ToString("n2") + " = " + Convert.ToDecimal(dt_adisyon_kalem.Rows[i]["tutar"]).ToString("c2") + "\n"; } DataTable dt_adisyon_fiyat = SQL.get("SELECT top_tutar = ISNULL(SUM((ak.miktar - ak.ikram_miktar) * u.fiyat), 0.0000) FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id WHERE ak.silindi = 0 AND ak.adisyon_id = " + tv_masalar.GetDataRow(hi.RowHandle)["adisyon_id"]); top_tutar = Convert.ToDecimal(dt_adisyon_fiyat.Rows[0]["top_tutar"]); DataTable dt_finans = SQL.get("SELECT top_tutar = ISNULL(SUM(miktar), 0.0000) FROM finans_hareket WHERE silindi = 0 AND hareket_tipi_parametre_id IN (25, 26, 27, 59) AND referans_id = " + tv_masalar.GetDataRow(hi.RowHandle)["adisyon_id"]); odenen = Convert.ToDecimal(dt_finans.Rows[0]["top_tutar"]); val += "\n--------------------------------------------------------------------------------------\nTop: " + (odenen).ToString("c2"); } /*if (elemInfo.TextBounds.Contains(e.ControlMousePosition)) * {*/ e.Info = new DevExpress.Utils.ToolTipControlInfo(elemInfo, val); /*break; * }*/ } } } }
private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { if (e.SelectedControl is DevExpress.XtraTreeList.TreeList) { TreeList tree = (TreeList)e.SelectedControl; TreeListHitInfo hit = tree.CalcHitInfo(e.ControlMousePosition); if (hit.HitInfoType == HitInfoType.Cell) { object cellInfo = new TreeListCellToolTipInfo(hit.Node, hit.Column, null); string name = (string)hit.Node[hit.Column]; string toolTip = ""; if (name.Length >= 18) { string dayOfYearStr = name.Substring(15, 3); //截取天数 string yearStr = name.Substring(13, 2); //截取年份 int dayOfYear = 0; int year = 0; if (int.TryParse(dayOfYearStr, out dayOfYear)) { if (int.TryParse(yearStr, out year)) { DateTime date = new DateTime(2000 + year, 1, 1).AddDays(dayOfYear - 1); string dateStr = date.ToString("yyyy年MM月dd日"); toolTip = string.Format("{0} ({1})", hit.Node[hit.Column], dateStr); } } } else { toolTip = string.Format("{0}", hit.Node[hit.Column]); } e.Info = new DevExpress.Utils.ToolTipControlInfo(cellInfo, toolTip); } } }
private void TpCtlr_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { if (e.SelectedControl != this.gridControl1) { return; } DevExpress.XtraGrid.Views.Grid.GridView view = this.gridControl1.GetViewAt(e.ControlMousePosition) as DevExpress.XtraGrid.Views.Grid.GridView; if (view == null) { return; } DevExpress.Utils.ToolTipControlInfo info = null; DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition); //if( hi.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowIndicator ) if (hi.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowCell) { if (hi.RowHandle == -2147483646) { return; } object o = hi.HitTest.ToString( ) + hi.RowHandle.ToString( ); string text = "Row " + hi.RowHandle.ToString( ); DevExpress.Utils.SuperToolTip stt = new DevExpress.Utils.SuperToolTip( ); stt.AllowHtmlText = DevExpress.Utils.DefaultBoolean.Default; stt.FixedTooltipWidth = false; stt.MaxWidth = 400; stt.DistanceBetweenItems = 10; DevExpress.Utils.SuperToolTipSetupArgs args = new DevExpress.Utils.SuperToolTipSetupArgs( ); args.AllowHtmlText = DevExpress.Utils.DefaultBoolean.Default; args.ShowFooterSeparator = true; { //var pnCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.OBJECT_FIELDNAME ); //var ptypeCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.PARENT_TYPE_FIELDNAME ); //var fqnCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.NAMEFULLQUALIFIED_FIELDNAME ); //var nCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.FIELD_FIELDNAME ); //var typeCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.TYPE_FIELDNAME ); // //args.Title.Text = typeCellValue?.ToString( ) + ": " + nCellValue?.ToString( ); //args.Contents.ImageOptions.Alignment = DevExpress.Utils.ToolTipImageAlignment.Default; //args.Contents.Text = fqnCellValue?.ToString( ); //args.Footer.Text = ptypeCellValue?.ToString( ) + ": " + pnCellValue?.ToString( ); //if( typeCellValue.ToString( ) == "Field" ) //{ // //args.Title.ImageOptions.Image = fld_noaction_gray_img16x16; // //args.Contents.ImageOptions.Image = fld_noaction_gray_img64x64; // //args.Footer.ImageOptions.Image = tbl_noaction_red_img16x16; //} //else if( typeCellValue.ToString( ) == "Table" ) //{ // //args.Title.ImageOptions.Image = tbl_noaction_red_img16x16; // //args.Contents.ImageOptions.Image = tbl_noaction_red_img64x64; // //args.Footer.ImageOptions.Image = sch_noaction_red_img16x16; //} //else if( typeCellValue.ToString( ) == "View" ) //{ // //args.Title.ImageOptions.Image = vw_noaction_red_img16x16; // //args.Contents.ImageOptions.Image = vw_noaction_red_img64x64; // //args.Footer.ImageOptions.Image = sch_noaction_red_img16x16; //} //else if( typeCellValue.ToString( ) == "ForeignKey" ) //{ // //args.Title.ImageOptions.Image = fk_noaction_gray_img16x16; // //args.Contents.ImageOptions.Image = fk_noaction_gray_img64x64; // //args.Footer.ImageOptions.Image = tbl_noaction_red_img16x16; //} //else if( typeCellValue.ToString( ) == "Procedure" ) //{ // //args.Title.ImageOptions.Image = proc_noaction_blue_img16x16; // //args.Contents.ImageOptions.Image = proc_noaction_blue_img64x64; // //args.Footer.ImageOptions.Image = sch_noaction_red_img16x16; //} //else if( typeCellValue.ToString( ) == "Synonym" ) //{ // //args.Title.ImageOptions.Image = syn_noaction_yellow_img16x16; // //args.Contents.ImageOptions.Image = syn_noaction_yellow_img64x64; // //args.Footer.ImageOptions.Image = sch_noaction_red_img16x16; //} //else if( typeCellValue.ToString( ) == "Schema" ) //{ // //args.Title.ImageOptions.Image = sch_noaction_red_img16x16; // //args.Contents.ImageOptions.Image = sch_noaction_red_img64x64; // //args.Footer.ImageOptions.Image = db_noaction_red_img16x16; //} //else if( typeCellValue.ToString( ) == "Database" ) //{ // //args.Title.ImageOptions.Image = db_noaction_red_img16x16; // //args.Contents.ImageOptions.Image = db_noaction_red_img64x64; // //args.Footer.ImageOptions.Image = db_noaction_red_img16x16; //} } stt.Setup(args); info = new DevExpress.Utils.ToolTipControlInfo(o, text); info.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip; info.SuperTip = stt; } if (info != null) { e.Info = info; } }
private void defaultToolTipController1_DefaultController_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { }
/// <summary> /// 激活 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { KzxSimpleButton btn = e.SelectedControl as KzxSimpleButton; e.Info = new DevExpress.Utils.ToolTipControlInfo(sender, sysClass.ssLoadMsgOrDefault(btn.ToolTipMessageCode, btn.ToolTipText), DevExpress.Utils.ToolTipIconType.Information); }