本文整理汇总了C#中Control.SetWidth方法的典型用法代码示例。如果您正苦于以下问题:C# Control.SetWidth方法的具体用法?C# Control.SetWidth怎么用?C# Control.SetWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control.SetWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FoldoutList
public FoldoutList( string title, float indentation, bool unfolded )
: base()
{
m_indentationAmount = indentation;
m_foldout = new Foldout( title, unfolded );
m_foldout.SetWidth( 100.0f, MetricsUnits.Percentage );
m_content = new Control();
m_content.SetWidth( 100.0f, MetricsUnits.Percentage );
m_content.AddDecorator( new StackContent( StackContent.StackMode.Vertical, StackContent.OverflowMode.Flow ) );
m_content.AddDecorator( new FitContent( false, true, false, true ) );
AddChild( m_foldout );
AddChild( m_content );
AddDecorator( new StackContent( StackContent.StackMode.Vertical, StackContent.OverflowMode.Flow ) );
AddDecorator( new FitContent( false, true, false, true ) );
m_foldout.ValueChange += FoldoutValueChange;
SetFoldState( unfolded );
}
示例2: 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 );
}
示例3: 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();
}