有一天我从代码项目(我认为)下载了一个代码,但我不知道原始下载链接是什么尝试使用这个
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Balloon.NET
{
public class BalloonWindow : Form
{
public static readonly int TIPMARGIN;
public static readonly int TIPTAIL;
public BalloonWindow();
public Point AnchorPoint { get; set; }
public BalloonWindow.BallonQuadrant Quadrant { get; }
public static Point AnchorPointFromControl(Control anchorControl);
protected override void Dispose(bool disposing);
protected override void OnLoad(EventArgs e);
protected virtual Rectangle OnNCCalcSize(Rectangle windowRect);
protected virtual void OnNCPaint(Graphics g);
protected override void OnResize(EventArgs e);
protected void RecalcLayout();
protected void RepositionWindow(Point oldAnchorPoint, Point newAnchorPoint);
public void ShowBalloon(Control anchorControl);
protected override void WndProc(ref Message m);
public enum BallonQuadrant
{
TopLeft = 0,
TopRight = 1,
BottomLeft = 2,
BottomRight = 3,
}
}
}
并使用此表格如下
Balloon.NET.BalloonWindow ms = new Balloon.NET.BalloonWindow();
private void numberEdit1_TextChanged(object sender, EventArgs e)
{
if (!ms.Visible)
{
ms.ShowBalloon(numberEdit1);
numberEdit1.Focus();
}
}