XtraTabHitInfo hi = tabPositionControl.CalcHitInfo(new Point(e.X, e.Y));
if (hi.HitTest == XtraTabHitTest.PageHeader)
{
// 这段话就是根据坐标(x, y)判断是否点击了Tab Header。这个e.X跟e.Y可以从MouseMove事件参数e里面来这你应该知道吧?
// 还可以通过XtraTabHitTest这个枚举值判断更多的情况。
}
private void xtraTabControl1_MouseMove(object sender, MouseEventArgs e) { XtraTabControl tabCtrl = sender as XtraTabControl; Point pt = MousePosition; XtraTabHitInfo info = tabCtrl.CalcHitInfo(tabCtrl.PointToClient(pt)); if (info.HitTest == XtraTabHitTest.PageHeader) { xtraTabControl1.SelectedTabPage = info.Page; } }