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


C# Panel.SetStyle方法代码示例

本文整理汇总了C#中Panel.SetStyle方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.SetStyle方法的具体用法?C# Panel.SetStyle怎么用?C# Panel.SetStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Panel的用法示例。


在下文中一共展示了Panel.SetStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddPanel

 private void AddPanel()
 {
     _panel = new Panel
                     {
                         SkinClass = typeof(PanelSkin4),
                         Title = "Panel " + _count,
                         MinWidth = 200,
                         MinHeight = 300
                     };
     _panel.SetStyle("headerBackgroundRollOverColor", Color.cyan);
     _hgroup.AddChild(_panel);
     _count++;
 }
开发者ID:groov0v,项目名称:edriven-gui,代码行数:13,代码来源:ViewportDemo.cs

示例2: CreateChildren

    protected override void CreateChildren()
    {
        base.CreateChildren();

        #region Heading

        TitleLabel button = new TitleLabel
        {
            StyleName = "title",
            HorizontalCenter = 0,
            Top = 20
        };

        AddChild(button);

        new TextRotator
        {
            Delay = 5, // 5 seconds delay
            Lines = new[]
                            {
                                "Drag and Drop Demo 2", 
                                "Created using eDriven.Gui",
                                //"Author: Danko Kozar",
                                "Drag items from the left panel (source)",
                                "Drop them to the right panel (destination)"
                            },
            Callback = delegate(string line) { button.Text = line; }
        }
            .Start();


        #endregion

        #region Box

        _box = new Group
                   {
                       HorizontalCenter = 0, VerticalCenter = 0,
                       Layout = new HorizontalLayout
                                    {
                                        HorizontalAlign = HorizontalAlign.Center,
                                        VerticalAlign = VerticalAlign.Top
                                    }
                   };

        // mandatory listeners
        AddEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown); // mouse down
        AddEventListener(DragEvent.DRAG_ENTER, OnDragEnter); // drag enter
        AddEventListener(DragEvent.DRAG_DROP, OnDragDrop); // drag drop (on drop target)

        // optional listeners
        AddEventListener(DragEvent.DRAG_START, OnDragStart); // drag start(on drag initiator)
        AddEventListener(DragEvent.DRAG_EXIT, OnDragExit); // drag exit (on drop target)
        AddEventListener(DragEvent.DRAG_COMPLETE, OnDragComplete); // drag complete (on drag initiator)

        //_box.AddEventListener(MouseEvent.MOUSE_OVER, OnMouseOver);
        //_box.AddEventListener(MouseEvent.MOUSE_OUT, OnMouseOut);
        //_box.AddEventListener(MouseEvent.MOUSE_UP, OnMouseUp);

        AddChild(_box);

        #endregion

        #region Source

        _pnlSource = new Panel
                         {
                             Title = "Source",
                             Icon = Resources.Load<Texture>("Icons/star"),
                             //Width = 450,
                             //Height = 500,
                             MouseEnabled = true,
                             SkinClass = typeof(PanelSkin2),
                             Layout = new TileLayout
                             {
                                 Orientation = TileOrientation.Rows,
                                 HorizontalGap = 10,
                                 VerticalGap = 10,
                                 RowHeight = 128 + 20, // image = 128x128, padding = 10 + 10
                                 ColumnWidth = 128 + 20,
                                 RequestedRowCount = 3,
                                 RequestedColumnCount = 3
                             }
                         };
        _pnlSource.SetStyle("addedEffect", _panelShowEffect);

        _box.AddChild(_pnlSource);

        Button btnReset = new Button
        {
            Text = "Reset",
            SkinClass = typeof(ImageButtonSkin),
            Icon = ImageLoader.Instance.Load("Icons/arrow_refresh")
        };
        btnReset.Press += delegate { InitChildren(); };
        _pnlSource.ControlBarGroup.AddChild(btnReset);

        /*Label lbl = new Label { Text = "miki" };
        _pnlSource.ControlBarGroup.AddChild(lbl);*/

//.........这里部分代码省略.........
开发者ID:groov0v,项目名称:edriven-gui,代码行数:101,代码来源:DragDropDemo2.cs


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