360安全浏览器右击不显示审查元素 或按F12不弹出开发人员工具的原因和解决方法:设为极速模式

IE兼容模式  会显示 IE的开发人员工具

极速模式 才会显示谷歌的那种方式

  • 6
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论
要实现失去焦点仍然高亮显示,可以在TreeView控件的DrawMode属性中选择OwnerDrawAll,然后在DrawNode事件中自定义节点的绘制方式,包括选中和非选中状态的绘制。具体实现可以参考以下代码: ``` private void treeView1_DrawNode(object sender, DrawTreeNodeEventArgs e) { // 绘制背景色 Color bgColor = e.Node.IsSelected ? SystemColors.Highlight : SystemColors.Window; using (SolidBrush brush = new SolidBrush(bgColor)) { e.Graphics.FillRectangle(brush, e.Bounds); } // 绘制文本 TextRenderer.DrawText(e.Graphics, e.Node.Text, Font, e.Bounds, SystemColors.WindowText, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine); // 绘制焦点框 if (e.Node.IsSelected) { ControlPaint.DrawFocusRectangle(e.Graphics, e.Bounds); } } ``` 要实现右击节点时才弹右键菜单,可以在TreeView控件的MouseDown事件中判断鼠标点击的位置是否在节点上,如果是则显示右键菜单。具体实现可以参考以下代码: ``` private void treeView1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { TreeNode clickedNode = treeView1.GetNodeAt(e.Location); if (clickedNode != null && clickedNode.Bounds.Contains(e.Location)) { contextMenuStrip1.Show(treeView1, e.Location); } } } ``` 要实现空白处右击不弹菜单,可以在TreeView控件的MouseDown事件中判断鼠标点击的位置是否在节点上,如果不是则取消右键菜单的显示。具体实现可以参考以下代码: ``` private void treeView1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { TreeNode clickedNode = treeView1.GetNodeAt(e.Location); if (clickedNode != null && clickedNode.Bounds.Contains(e.Location)) { contextMenuStrip1.Show(treeView1, e.Location); } else { e.Cancel = true; } } } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小黄人软件

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值