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
- HtmlShim.cs
- PopOutPanel.cs
- MarkupCompilePass1.cs
- CounterCreationData.cs
- HTMLTextWriter.cs
- ObjectViewFactory.cs
- _SSPIWrapper.cs
- XmlDataLoader.cs
- RoutedCommand.cs
- WebBrowser.cs
- TypeSystem.cs
- XamlSerializerUtil.cs
- RectangleF.cs
- StackSpiller.cs
- Point3D.cs
- MailDefinition.cs
- SectionInput.cs
- RawKeyboardInputReport.cs
- CodeAssignStatement.cs
- TextPatternIdentifiers.cs
- ReadOnlyHierarchicalDataSource.cs
- RemoveStoryboard.cs
- OracleParameterBinding.cs
- basecomparevalidator.cs
- Geometry3D.cs
- HiddenField.cs
- Property.cs
- Themes.cs
- BamlLocalizer.cs
- Vector3DAnimationBase.cs
- Inline.cs
- ClassImporter.cs
- IndentedWriter.cs
- ControlBuilder.cs
- BinaryOperationBinder.cs
- PTConverter.cs
- MonthChangedEventArgs.cs
- FormViewRow.cs
- Events.cs
- objectresult_tresulttype.cs
- MouseActionConverter.cs
- FrameworkContentElement.cs
- WorkflowEventArgs.cs
- SafeCoTaskMem.cs
- FixedSOMTextRun.cs
- NumericPagerField.cs
- SqlLiftIndependentRowExpressions.cs
- AlphaSortedEnumConverter.cs
- XmlSchemaDatatype.cs
- String.cs
- BoundsDrawingContextWalker.cs
- QilName.cs
- XmlSchemaElement.cs
- QueryInterceptorAttribute.cs
- KeyboardDevice.cs
- SettingsAttributeDictionary.cs
- SecurityException.cs
- DecimalAnimationBase.cs
- MethodToken.cs
- OdbcDataAdapter.cs
- BitVector32.cs
- HyperlinkAutomationPeer.cs
- Coordinator.cs
- MetadataItemSerializer.cs
- HttpPostLocalhostServerProtocol.cs
- DateTimeConstantAttribute.cs
- AutoFocusStyle.xaml.cs
- IpcChannel.cs
- ValueTable.cs
- MultipleViewPattern.cs
- StateInitialization.cs
- ComAwareEventInfo.cs
- AtomPub10CategoriesDocumentFormatter.cs
- ImmutablePropertyDescriptorGridEntry.cs
- SiteMapProvider.cs
- InternalTypeHelper.cs
- OutputCacheProviderCollection.cs
- LayoutManager.cs
- Content.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- FormViewDeletedEventArgs.cs
- Enumerable.cs
- AsyncOperation.cs
- PropertyChangeTracker.cs
- BreakRecordTable.cs
- ConstructorExpr.cs
- ListViewItem.cs
- ByteStreamMessageEncoderFactory.cs
- RepeaterItem.cs
- LayoutDump.cs
- DecoderFallbackWithFailureFlag.cs
- InputReport.cs
- Pointer.cs
- PeerNearMe.cs
- StubHelpers.cs
- QilStrConcatenator.cs
- TransformPattern.cs
- ParameterCollection.cs
- ProfileGroupSettings.cs
- TextShapeableCharacters.cs