本文整理汇总了C#中System.Windows.Forms.CheckedListBox.IndexFromPoint方法的典型用法代码示例。如果您正苦于以下问题:C# CheckedListBox.IndexFromPoint方法的具体用法?C# CheckedListBox.IndexFromPoint怎么用?C# CheckedListBox.IndexFromPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.CheckedListBox
的用法示例。
在下文中一共展示了CheckedListBox.IndexFromPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: questTypeList_MouseMove
private void questTypeList_MouseMove(object sender, MouseEventArgs e)
{
_lastList = (CheckedListBox)sender;
int index = _lastList.IndexFromPoint(e.X, e.Y);
// no valid index found in list skip display of tooltip
if (index < 0)
return;
Object item = _lastList.Items[index];
if (item == null)
{
// The mouse isn't over any item -- hide the tooltip
toolTip.Active = false;
tooltipTimer.Enabled = false;
}
else if (item != _lastItem)
{
// The item has changed, hide the tooltip
// and restart the timer.
toolTip.Active = false;
tooltipTimer.Tick += new EventHandler(tooltipTimer_Tick);
tooltipTimer.Enabled = true;
if (sender == triggerTypeList)
{
_lastItemText = GetTriggerHelp(GetTriggerTypeForDescription(Convert.ToString(triggerTypeList.Items[index])));
}
else if (sender == requirementTypeList)
{
_lastItemText = GetRequirementHelp(GetRequirementTypeForDescription(Convert.ToString(requirementTypeList.Items[index])));
} if (sender == actionTypeList)
{
_lastItemText = GetActionHelp(GetActionTypeForDescription(Convert.ToString(actionTypeList.Items[index])));
}
}
else
{
// It's the same item -- ignore it.
}
_lastItem = item;
}