当前位置: 首页>>代码示例>>C#>>正文


C# dfControl.Focus方法代码示例

本文整理汇总了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();
            }

        };
    }
开发者ID:haozi000005,项目名称:happy2d,代码行数:40,代码来源:DemoBrowseGrid.cs

示例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();
     }
 }
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:67,代码来源:BackButton.cs


注:本文中的dfControl.Focus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。