c# 如何让tooltip显示文字换行

在代码中可以,Environment.NewLine
如:
public string GetCheckNote(string plantext)
        {
            string checknote = "";
            string sql = "SELECT Checker,CheckNote FROM emsCheckPlanRecordCheck WHERE PlanText=@PlanText  order by lastedited asc";
            SqlParameter[] pars =
                    {
                        new SqlParameter("@PlanText",SqlDbType.NVarChar)
                    };
            pars[0].Value = plantext;
            DataSet set = !CommonWebDataServer.CheckServer() ? GetDataSet(sql, pars, CommonWebDataServer.ChLoginServerStr()) : GetDataSet(sql, pars);
            if (set != null && set.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in set.Tables[0].Rows)
                {
                    checknote += row["Checker"].ToString() + ":" + row["CheckNote"].ToString() + Environment.NewLine;
                }
            }
            checknote = !string.IsNullOrEmpty(checknote) && checknote.EndsWith(Environment.NewLine) ? checknote.Substring(0, checknote.Length - 1) : checknote;
            return checknote;
        }

 

posted @   左正  阅读(2718)  评论(0编辑  收藏  举报
编辑推荐:
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
· ASP.NET Core 模型验证消息的本地化新姿势
阅读排行:
· 开发的设计和重构,为开发效率服务
· 从零开始开发一个 MCP Server!
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· Ai满嘴顺口溜,想考研?浪费我几个小时
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
点击右上角即可分享
微信分享提示