zoukankan      html  css  js  c++  java
  • 鼠标移到控件上显示,移出控件消失

     1 using System;
     2 using System.Collections.Generic;
     3 using System.ComponentModel;
     4 using System.Data;
     5 using System.Drawing;
     6 using System.Text;
     7 using System.Windows.Forms;
     8 
     9 namespace juxing
    10 {
    11     public partial class Form1 : Form
    12     {
    13         public Form1()
    14         {
    15             InitializeComponent();
    16         }
    17 
    18         private void Form1_Load(object sender, EventArgs e)
    19         {          
    20             button1.Visible = false;
    21         }
    22 
    23         private void Form1_MouseMove(object sender, MouseEventArgs e)
    24         {         
    25              Point point= this.PointToScreen(new Point(e.X, e.Y));
    26              Rectangle rc = this.button1.RectangleToScreen(this.button1.ClientRectangle);
    27              if (rc.Contains(point))
    28              {
    29                  button1.Visible = true;
    30              }
    31              else
    32              {
    33                  button1.Visible = false;
    34              }           
    35         }                 
    36     }
    37 }
  • 相关阅读:
    Servlet开发
    HTML实现页面自动跳转的五种方法
    AVAYA话机管理
    AVAYA路由
    报关相关知识
    基本杆法
    AVAYA初始配置
    加塞和瞄准
    基本杆法图解
    AVAYA拨号计划
  • 原文地址:https://www.cnblogs.com/code1992/p/2860774.html
Copyright © 2011-2022 走看看