本文整理汇总了C#中Control.SetMargin方法的典型用法代码示例。如果您正苦于以下问题:C# Control.SetMargin方法的具体用法?C# Control.SetMargin怎么用?C# Control.SetMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control.SetMargin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddItem
public void AddItem( Control item )
{
item.SetMargin( m_indentationAmount, 0.0f, 0.0f, 0.0f, MetricsUnits.Pixel );
item.SetWidth( 100.0f, MetricsUnits.Percentage );
m_content.AddChild( item );
}
示例2: OnInitialize
protected override void OnInitialize()
{
m_generator = new UFormsCodeGenerator();
title = "Control Designer";
m_menu = new DesignerTopMenu();
m_menu.SetSize( 100.0f, CONTROL_DISPLAY_HEIGHT, Control.MetricsUnits.Percentage, Control.MetricsUnits.Pixel );
m_menu.MenuOptionSelected += HandleMenuOptionSelected;
AddChild( m_menu );
m_inspectorFields = new Dictionary<object, PropertyInfo>();
m_hierarchyItems = new Dictionary<Control, HierarchyItem>();
m_inspector = new Control();
m_inspector.SetPosition( position.width - INSPECTOR_WIDTH , CONTROL_DISPLAY_HEIGHT + TOP_MENU_SPACING );
m_inspector.SetWidth( INSPECTOR_WIDTH );
m_inspector.SetMargin( 0.0f, 0.0f, SIDE_MARGIN, 0.0f );
m_inspector.AddDecorator( new StackContent( StackContent.StackMode.Vertical, StackContent.OverflowMode.Flow ) );
AddChild( m_inspector );
m_hierarchy = new Control();
m_hierarchy.SetPosition( 0.0f, CONTROL_DISPLAY_HEIGHT + TOP_MENU_SPACING );
m_hierarchy.SetWidth( HIERARCHY_WIDTH );
m_hierarchy.SetMargin( SIDE_MARGIN, 0.0f, 0.0f, 0.0f );
m_hierarchy.AddDecorator( new StackContent( StackContent.StackMode.Vertical, StackContent.OverflowMode.Flow ) );
AddChild( m_hierarchy );
m_workarea = new Control();
m_workarea.SetPosition( m_viewportOffset );
m_workarea.AddDecorator( new ClipContent() );
AddChild( m_workarea );
m_resizeHandle = new Control();
m_resizeHandle.SetSize( RESIZE_HANDLE_SIZE, RESIZE_HANDLE_SIZE );
m_resizeHandle.AddDecorator( new BackgroundColor( Color.blue ) );
m_resizeHandle.Visibility = Control.VisibilityMode.Hidden;
AddChild( m_resizeHandle );
SetSelectedControl( null );
SetInspectorTarget( null );
ShowToolbox();
}