```c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace mqtt
{
public class lineType
{
public string Name{get; set;}
public string Value{get; set;}
public string Unit{get; set;}
public lineType(string name, string value)
{
this.Name = name;
this.Value = value;
this.Unit = "";
}
public lineType()
{
}
}
public partial class Frm_Info : Form
{
public List<lineType> mShowList = new List<lineType>();
public Frm_Info()
{
InitializeComponent();
Timer tm = new Timer();
tm.Interval = 100;
tm.Tick += tm_Tick;
tm.Start();
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.TopLevel = true;
mShowList.Add(new lineType("w1", "100") );
mShowList.Add(new lineType("w2", "110"));
mShowList.Add(new lineType("w3", "120"));
mShowList.Add(new lineType("w4", "130"));
InitDgv(dgv1);
}
private void InitDgv(DataGridView dgv)
{
dgv.DataSource = mShowList;
dgv.BackgroundColor = Color.Yellow;
dgv.ForeColor = Color.Red;
dgv.Columns[0].Width = 50;
dgv.Columns[1].Width = 120;
dgv.Columns[dgv.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
this.Height = dgv.Rows[0].Height * ( mShowList.Count() + 1 ) ;
for(int i = 0; i< dgv.Rows.Count; i++)
{
dgv.Rows[i].DefaultCellStyle.BackColor = System.Drawing.Color.DarkGreen;
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
}
//dgv.Refresh();
}
void tm_Tick(object sender, EventArgs e)
{
Point screenPoint = Control.MousePosition;//鼠标相对于屏幕左上角的坐标
Point formPoint = this.PointToClient(Control.MousePosition);//鼠标相对于窗体左上角的坐标
Console.WriteLine("x " + screenPoint.X + "y " + screenPoint.Y);
this.Location = new Point(screenPoint.X + 10, screenPoint.Y + 10);
}
}
}
```