本文整理汇总了C#中System.Windows.Forms.Label.GetChildAtPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Label.GetChildAtPoint方法的具体用法?C# Label.GetChildAtPoint怎么用?C# Label.GetChildAtPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Label
的用法示例。
在下文中一共展示了Label.GetChildAtPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: showMotorState
/// <summary>
/// Zobrazí stav konkrétního motoru
/// </summary>
/// <param name="motorView">vizualizace motoru</param>
/// <param name="state">stav</param>
/// <param name="message">zpráva ke stavu</param>
/// <param name="motorId">id motoru</param>
private void showMotorState(Label motorView, MotorState state, String message, MotorId motorId, int speed, int position) {
switch (state)
{
case MotorState.error:
motorView.BackColor = Color.Red;
break;
case MotorState.enabled:
motorView.BackColor = Color.Green;
break;
case MotorState.disabled:
motorView.BackColor = Color.LightSlateGray;
break;
case MotorState.running:
motorView.BackColor = Color.Orange;
break;
}
this.Invoke((MethodInvoker)delegate
{
((Label)motorView.GetChildAtPoint(new Point(0,0))).Text = speed.ToString();
motorView.Text = position.ToString();
toolTip.SetToolTip(motorView, "ID motoru: " + motorId + "\nStav motoru: " + state + "\nZpráva: " + message);
motorView.Update();
});
}