From e19ea4337fa65725e6e22073a7b600dcc9887d4b Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 07 四月 2025 08:27:54 +0800
Subject: [PATCH] 鸟嘴提示
---
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 81 ++++++++++++++++++++++++++++++++++++----
1 files changed, 73 insertions(+), 8 deletions(-)
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index b68706e..f9529c2 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -14,13 +14,14 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
-using DevExpress.DataAccess.Native.EntityFramework;
+using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Menu;
using DevExpress.XtraGrid.Views.Grid;
+using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraTab;
using DevExpress.XtraTreeList;
using Gs.DevApp.Entity;
@@ -324,6 +325,7 @@
if (cols.Length > 0)
{
var colType = cols[0];
+
if (colType is LookUpEdit)
{
var txt = colType as LookUpEdit;
@@ -362,6 +364,14 @@
else
txt.Text = strVal;
txt.ReadOnly = isEdt;
+ continue;
+ }
+ if (colType is ButtonEdit)
+ {
+ var txt = colType as ButtonEdit;
+ if (txt != null)
+ txt.Text = strVal;
+ txt.Enabled = !isEdt;
continue;
}
//鏂囨湰
@@ -479,6 +489,7 @@
txt.Text = strVal;
}
}
+
//鑷畾涔変粨搴�
if (colType is UcLookCk)
{
@@ -710,6 +721,13 @@
txt.ReadOnly = isEdt;
continue;
}
+ if (ctrl is ButtonEdit)
+ {
+ var txt = ctrl as ButtonEdit;
+ txt.Text = "";
+ txt.Enabled = !isEdt;
+ continue;
+ }
//鏂囨湰
if (ctrl is TextEdit)
{
@@ -841,7 +859,7 @@
txt.IsReadly = isEdt;
continue;
}
-
+
//鑷畾閮ㄩ棬
if (ctrl is UcLookDepartment)
{
@@ -932,6 +950,19 @@
}
foreach (Control ctrl in controls)
{
+ //涓嬫媺
+ if (ctrl is ComboBoxEdit)
+ {
+ var txt = ctrl as ComboBoxEdit;
+ txt.ReadOnly = isEdt;
+ continue;
+ }
+ if (ctrl is ButtonEdit)
+ {
+ var txt = ctrl as ButtonEdit;
+ txt.Enabled = !isEdt;
+ continue;
+ }
//鏂囨湰
if (ctrl is TextEdit)
{
@@ -962,14 +993,12 @@
txt.ReadOnly = isEdt;
continue;
}
-
//鏃ユ湡
if (ctrl is DateTimePicker)
{
ctrl.Enabled = !isEdt;
continue;
}
-
//鍗曢��
if (ctrl is CheckBox)
{
@@ -1060,7 +1089,7 @@
txt.IsReadly = isEdt;
continue;
}
-
+
//鑷畾閮ㄩ棬
if (ctrl is UcLookDepartment)
{
@@ -1662,7 +1691,7 @@
/// <param name="fileName">瀛楁</param>
/// <param name="icoName">鍥炬爣璺緞</param>
/// <param name="action"></param>
- public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null)
+ public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null, DevExpress.Utils.ToolTipController tips = null)
{
gridView1.PopupMenuShowing += (s, e) =>
{
@@ -1789,8 +1818,44 @@
//}
}
};
-
-
+ if (tips != null)
+ {
+ tips.Appearance.BackColor = Color.LightBlue; // 璁剧疆鑳屾櫙棰滆壊
+ tips.Appearance.ForeColor = Color.Black; // 璁剧疆鍓嶆櫙鑹诧紙鏂囧瓧棰滆壊锛�
+ gridView1.MouseMove += (s, e) =>
+ {
+ try
+ {
+ GridHitInfo hi = gridView1.CalcHitInfo(new Point(e.X, e.Y));
+ if (hi.InRowCell)
+ {
+ int cuRowHandle = hi.RowHandle;
+ if (cuRowHandle < 0)
+ return;
+ DataRow curRow = gridView1.GetDataRow(cuRowHandle);
+ var column = hi.Column;
+ string showTxt = curRow[column.FieldName].ToString();
+ ToolTipControllerShowEventArgs aa = new ToolTipControllerShowEventArgs();
+ aa.AllowHtmlText = DefaultBoolean.True;
+ aa.Title = column.Caption; //HTML, 绮椾綋
+ aa.ToolTip = showTxt; //鏂
+ aa.ShowBeak = true;
+ aa.Rounded = true; ////鍦嗚
+ aa.RoundRadius = 7; //鍦嗚鐜�
+ // aa.ToolTipType = ToolTipType.SuperTip; //瓒呯骇鏍峰紡锛屽彲澶氳鎴栨樉绀哄浘鏍�
+ aa.ToolTipType = ToolTipType.Standard;//鏍囧噯鏍峰紡锛屽彲鏄剧ず楦熷槾銆�
+ aa.IconType = ToolTipIconType.Information; //娑堟伅鍥炬爣
+ aa.IconSize = ToolTipIconSize.Small; //澶у浘鏍�
+ tips.ShowHint(aa);
+ }
+ else
+ tips.HideHint();
+ }
+ catch (Exception exception)
+ {
+ }
+ };
+ }
}
private static void ActiveEditor_MouseUp(object sender, MouseEventArgs e)
{
--
Gitblit v1.9.3