本文整理汇总了C#中dfControl.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# dfControl.Focus方法的具体用法?C# dfControl.Focus怎么用?C# dfControl.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dfControl
的用法示例。
在下文中一共展示了dfControl.Focus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: initializeRowEvents
private void initializeRowEvents( DemoHostedGameInfo item, dfControl row, int itemIndex )
{
row.MouseEnter += ( sender, args ) => { row.Focus(); };
row.EnterFocus += ( sender, args ) =>
{
this.SelectedItem = item;
if( SelectionChanged != null ) SelectionChanged( item );
if( selectedItemProxy != null ) selectedItemProxy.Data = item;
};
row.KeyDown += ( sender, args ) =>
{
if( args.Used )
return;
if( args.KeyCode == KeyCode.DownArrow )
{
selectNext( itemIndex );
args.Use();
}
else if( args.KeyCode == KeyCode.UpArrow )
{
selectPrevious( itemIndex );
args.Use();
}
else if( args.KeyCode == KeyCode.Home )
{
selectFirst();
args.Use();
}
else if( args.KeyCode == KeyCode.End )
{
selectLast();
args.Use();
}
};
}
示例2: OnMouseDown
public void OnMouseDown(dfControl control, dfMouseEventArgs mouseEvent)
{
if (tabcontainer.SelectedIndex == 8)
{
tabcontainer.SelectedIndex = 3;
Hide();
ConfirmButton.cb.button.Text = "Confirm";
ConfirmButton.cb.button.IsVisible = false;
ConfirmButton.cb.title.Display("Main Menu");
return;
}
if (tabcontainer.SelectedIndex == 6)
{
tabcontainer.SelectedIndex = 3;
Hide();
ConfirmButton.cb.button.Text = "Confirm";
ConfirmButton.cb.button.IsVisible = false;
ConfirmButton.cb.title.Display("Main Menu");
return;
}
if (tabcontainer.SelectedIndex == 5)
{
MenuCamera.mc.zoomOut();
Hide();
control.Focus();
foreach (HPSelectButton hpb in HPbuttonGenerator.btg.HPbuttons)
{
hpb.indicateInactive();
}
foreach (HPSelectButton hpb in HPbuttonGenerator.btg.HPbuttons)
{
hpb.Hide();
}
ConfirmButton.cb.title.Display("Main Menu");
return;
}
tabcontainer.SelectedIndex--;
if(tabcontainer.SelectedIndex == 1 || tabcontainer.SelectedIndex ==3)
{
Hide();
}
if (tabcontainer.SelectedIndex == 1)//refund for money spent on ship;
{
switch (GameManager.Instance.hullSelection)
{
case Ship.PlayerController.pHull.Anvil:
GameManager.Instance.Money += Ship.PlayerController.AnvilCost;
break;
case Ship.PlayerController.pHull.Viper:
GameManager.Instance.Money += Ship.PlayerController.ViperCost;
break;
case Ship.PlayerController.pHull.Shark:
GameManager.Instance.Money += Ship.PlayerController.SharkCost;
break;
case Ship.PlayerController.pHull.Marauder:
GameManager.Instance.Money += Ship.PlayerController.MarauderCost;
break;
case Ship.PlayerController.pHull.Vulture:
GameManager.Instance.Money += Ship.PlayerController.VultureCost;
break;
case Ship.PlayerController.pHull.Dragonfly:
GameManager.Instance.Money += Ship.PlayerController.DragonflyCost;
break;
}
ShipSprite.ss.resetSprite();
}
}