Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / FlowLayoutPanel.cs / 1 / FlowLayoutPanel.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms.Layout;
using System.Runtime.InteropServices;
///
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ProvideProperty("FlowBreak", typeof(Control))]
[DefaultProperty("FlowDirection")]
[Designer("System.Windows.Forms.Design.FlowLayoutPanelDesigner, " + AssemblyRef.SystemDesign)]
[Docking(DockingBehavior.Ask)]
[SRDescription(SR.DescriptionFlowLayoutPanel)]
public class FlowLayoutPanel : Panel, IExtenderProvider {
private FlowLayoutSettings _flowLayoutSettings;
///
public FlowLayoutPanel() {
_flowLayoutSettings = FlowLayout.CreateSettings(this);
}
///
public override LayoutEngine LayoutEngine {
get { return FlowLayout.Instance; }
}
///
[SRDescription(SR.FlowPanelFlowDirectionDescr)]
[DefaultValue(FlowDirection.LeftToRight)]
[SRCategory(SR.CatLayout)]
[Localizable(true)]
public FlowDirection FlowDirection {
get { return _flowLayoutSettings.FlowDirection; }
set {
_flowLayoutSettings.FlowDirection = value;
Debug.Assert(FlowDirection == value, "FlowDirection should be the same as we set it");
}
}
///
[SRDescription(SR.FlowPanelWrapContentsDescr)]
[DefaultValue(true)]
[SRCategory(SR.CatLayout)]
[Localizable(true)]
public bool WrapContents {
get { return _flowLayoutSettings.WrapContents; }
set {
_flowLayoutSettings.WrapContents = value;
Debug.Assert(WrapContents == value, "WrapContents should be the same as we set it");
}
}
#region Provided properties
///
///
bool IExtenderProvider.CanExtend(object obj) {
Control control = obj as Control;
return control != null && control.Parent == this;
}
[DefaultValue(false)]
[DisplayName("FlowBreak")]
public bool GetFlowBreak(Control control) {
return _flowLayoutSettings.GetFlowBreak(control);
}
[DisplayName("FlowBreak")]
public void SetFlowBreak(Control control, bool value) {
_flowLayoutSettings.SetFlowBreak(control, value);
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms.Layout;
using System.Runtime.InteropServices;
///
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ProvideProperty("FlowBreak", typeof(Control))]
[DefaultProperty("FlowDirection")]
[Designer("System.Windows.Forms.Design.FlowLayoutPanelDesigner, " + AssemblyRef.SystemDesign)]
[Docking(DockingBehavior.Ask)]
[SRDescription(SR.DescriptionFlowLayoutPanel)]
public class FlowLayoutPanel : Panel, IExtenderProvider {
private FlowLayoutSettings _flowLayoutSettings;
///
public FlowLayoutPanel() {
_flowLayoutSettings = FlowLayout.CreateSettings(this);
}
///
public override LayoutEngine LayoutEngine {
get { return FlowLayout.Instance; }
}
///
[SRDescription(SR.FlowPanelFlowDirectionDescr)]
[DefaultValue(FlowDirection.LeftToRight)]
[SRCategory(SR.CatLayout)]
[Localizable(true)]
public FlowDirection FlowDirection {
get { return _flowLayoutSettings.FlowDirection; }
set {
_flowLayoutSettings.FlowDirection = value;
Debug.Assert(FlowDirection == value, "FlowDirection should be the same as we set it");
}
}
///
[SRDescription(SR.FlowPanelWrapContentsDescr)]
[DefaultValue(true)]
[SRCategory(SR.CatLayout)]
[Localizable(true)]
public bool WrapContents {
get { return _flowLayoutSettings.WrapContents; }
set {
_flowLayoutSettings.WrapContents = value;
Debug.Assert(WrapContents == value, "WrapContents should be the same as we set it");
}
}
#region Provided properties
///
///
bool IExtenderProvider.CanExtend(object obj) {
Control control = obj as Control;
return control != null && control.Parent == this;
}
[DefaultValue(false)]
[DisplayName("FlowBreak")]
public bool GetFlowBreak(Control control) {
return _flowLayoutSettings.GetFlowBreak(control);
}
[DisplayName("FlowBreak")]
public void SetFlowBreak(Control control, bool value) {
_flowLayoutSettings.SetFlowBreak(control, value);
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FormViewInsertEventArgs.cs
- XmlSchemaObjectCollection.cs
- ScaleTransform3D.cs
- RawStylusInput.cs
- LabelTarget.cs
- StringValidatorAttribute.cs
- DataListComponentEditor.cs
- IntPtr.cs
- __Filters.cs
- ObjectFullSpanRewriter.cs
- ToolStripSeparator.cs
- SqlTriggerContext.cs
- WebControl.cs
- XmlNodeChangedEventArgs.cs
- LowerCaseStringConverter.cs
- BaseTreeIterator.cs
- SoapEnvelopeProcessingElement.cs
- PersonalizationStateQuery.cs
- DataViewManager.cs
- SecurityContext.cs
- GlyphRunDrawing.cs
- TypeLibConverter.cs
- PtsContext.cs
- DynamicControlParameter.cs
- Style.cs
- BulletChrome.cs
- XmlTextEncoder.cs
- DictionaryChange.cs
- Form.cs
- GridPattern.cs
- StackOverflowException.cs
- DispatcherFrame.cs
- DropDownList.cs
- ListViewItem.cs
- HScrollBar.cs
- ReadOnlyDataSourceView.cs
- ConfigurationProperty.cs
- WindowsListViewGroupHelper.cs
- DSASignatureFormatter.cs
- PathGeometry.cs
- JavaScriptSerializer.cs
- ContentPlaceHolder.cs
- SqlNodeTypeOperators.cs
- LineInfo.cs
- NotifyIcon.cs
- ResourcesBuildProvider.cs
- CreateUserErrorEventArgs.cs
- TreeIterator.cs
- ViewBase.cs
- MetadataCache.cs
- Cursors.cs
- PeerObject.cs
- ThreadAbortException.cs
- RoutedUICommand.cs
- RelationshipEntry.cs
- EditorOptionAttribute.cs
- AppDomainFactory.cs
- CodeExpressionStatement.cs
- IndexingContentUnit.cs
- StrongName.cs
- DrawingBrush.cs
- RectangleHotSpot.cs
- _ConnectionGroup.cs
- GenerateHelper.cs
- CryptoConfig.cs
- XmlArrayItemAttribute.cs
- XPathNodePointer.cs
- OracleBinary.cs
- GeneralTransform2DTo3DTo2D.cs
- String.cs
- LongValidator.cs
- LocalizableResourceBuilder.cs
- EntityProxyTypeInfo.cs
- TransformGroup.cs
- AVElementHelper.cs
- SafeNativeMethods.cs
- HttpVersion.cs
- TextTabProperties.cs
- AttachedAnnotation.cs
- ThreadStaticAttribute.cs
- MouseActionConverter.cs
- TransportReplyChannelAcceptor.cs
- ModelVisual3D.cs
- WebSysDisplayNameAttribute.cs
- HttpDebugHandler.cs
- CompiledRegexRunner.cs
- ItemsControlAutomationPeer.cs
- ViewCellSlot.cs
- TCEAdapterGenerator.cs
- VisemeEventArgs.cs
- InvalidCastException.cs
- DataGridViewAccessibleObject.cs
- LexicalChunk.cs
- TypeForwardedToAttribute.cs
- Int32Converter.cs
- CodeTryCatchFinallyStatement.cs
- PEFileEvidenceFactory.cs
- BitmapCodecInfo.cs
- ValidationPropertyAttribute.cs
- CommandEventArgs.cs