Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / TableLayoutPanelResizeGlyph.cs / 1 / TableLayoutPanelResizeGlyph.cs
namespace System.Windows.Forms.Design.Behavior { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Design; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms.Design; ////// /// This glyph is associated with every row/column line rendered by the TableLayouPanelDesigner. // Each glyph simply tracks the bounds, type (row or column), and row/col style that it is associated // with. All glyphs on a TableLayoutPanelDesigner share one instance of the TableLayoutPanelBehavior. /// internal class TableLayoutPanelResizeGlyph : Glyph { private Rectangle bounds;//bounds of the column/row line private Cursor hitTestCursor;//cursor used for hittesting - vsplit/hsplit private TableLayoutStyle style;//the style (row or column) associated private TableLayoutResizeType type;//the "Type" used by the Behavior for resizing ////// /// This constructor caches our necessary state and determine what 'type' /// it is. /// internal TableLayoutPanelResizeGlyph (Rectangle controlBounds, TableLayoutStyle style, Cursor hitTestCursor, Behavior behavior) : base(behavior) { this.bounds = controlBounds; this.hitTestCursor = hitTestCursor; this.style = style; if (style is ColumnStyle) { type = TableLayoutResizeType.Column; } else { type = TableLayoutResizeType.Row; } } ////// /// Represents the bounds of the row or column line being rendered /// by the TableLayoutPanelDesigner. /// public override Rectangle Bounds { get { return bounds; } } ////// /// Represents the Style associated with this glyph: Row or Column. /// This is used by the behaviors resize methods to set the values. /// public TableLayoutStyle Style { get { return style; } } ////// /// Used as quick check by our behavior when dragging/resizing. /// public TableLayoutResizeType Type { get { return type; } } ////// /// Simply returns the proper cursor if the mouse pointer is within /// our cached boudns. /// public override Cursor GetHitTest(Point p) { if (bounds.Contains(p)) { return hitTestCursor; } return null; } ////// /// No painting necessary - this glyph is more of a 'hot spot' /// public override void Paint(PaintEventArgs pe) { } ////// /// Internal Enum defining the two different types of glyphs a TableLayoutPanel /// can have: column or row. /// public enum TableLayoutResizeType { Column, Row } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataListItem.cs
- ImageSourceValueSerializer.cs
- PageBreakRecord.cs
- QuadraticBezierSegment.cs
- MouseBinding.cs
- OverlappedAsyncResult.cs
- SystemNetworkInterface.cs
- BuilderPropertyEntry.cs
- CalendarDay.cs
- TemplateColumn.cs
- FilePrompt.cs
- SamlAssertionKeyIdentifierClause.cs
- ApplyTemplatesAction.cs
- BitVec.cs
- SpellCheck.cs
- DataGridSortCommandEventArgs.cs
- Stack.cs
- sqlmetadatafactory.cs
- VirtualizingPanel.cs
- UrlMappingsSection.cs
- ViewStateModeByIdAttribute.cs
- RectangleConverter.cs
- ElementProxy.cs
- FeatureAttribute.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- ChameleonKey.cs
- TransformerInfoCollection.cs
- MemberInfoSerializationHolder.cs
- DrawListViewSubItemEventArgs.cs
- OdbcError.cs
- TextOnlyOutput.cs
- VirtualPathProvider.cs
- PrimitiveDataContract.cs
- LinqMaximalSubtreeNominator.cs
- BamlLocalizer.cs
- EventWaitHandleSecurity.cs
- PositiveTimeSpanValidatorAttribute.cs
- WebPartTransformerCollection.cs
- ICspAsymmetricAlgorithm.cs
- FacetDescriptionElement.cs
- SubpageParaClient.cs
- DataGridViewCheckBoxColumn.cs
- _SSPISessionCache.cs
- ScriptingAuthenticationServiceSection.cs
- CreateUserWizardStep.cs
- DbParameterHelper.cs
- MultiAsyncResult.cs
- JsonSerializer.cs
- CompleteWizardStep.cs
- EventTrigger.cs
- StorageAssociationSetMapping.cs
- WindowsFormsSectionHandler.cs
- DataGridAutomationPeer.cs
- SqlDeflator.cs
- SaveWorkflowCommand.cs
- SpAudioStreamWrapper.cs
- UshortList2.cs
- Html32TextWriter.cs
- ToolStripItemImageRenderEventArgs.cs
- MenuItem.cs
- InkCanvasSelection.cs
- DrawingCollection.cs
- FormsAuthenticationUserCollection.cs
- BatchWriter.cs
- MatrixAnimationUsingPath.cs
- ActivationServices.cs
- SqlTypesSchemaImporter.cs
- TraceInternal.cs
- RelationshipConstraintValidator.cs
- Triangle.cs
- Missing.cs
- KeyPullup.cs
- IdSpace.cs
- ToolboxDataAttribute.cs
- SqlConnectionHelper.cs
- Rotation3DKeyFrameCollection.cs
- QilSortKey.cs
- ObjectItemCollection.cs
- ExpressionVisitorHelpers.cs
- DefinitionUpdate.cs
- HelpInfo.cs
- DataServiceEntityAttribute.cs
- NativeMethods.cs
- GroupItem.cs
- HostingEnvironment.cs
- AxisAngleRotation3D.cs
- FixedSOMLineCollection.cs
- LinkButton.cs
- FixedPage.cs
- WebPartCancelEventArgs.cs
- RelationshipConverter.cs
- RecognizerInfo.cs
- EnumBuilder.cs
- BlurEffect.cs
- ServiceContractGenerationContext.cs
- InfiniteIntConverter.cs
- OrderByBuilder.cs
- TriggerBase.cs
- BitmapMetadataEnumerator.cs
- ObjectIDGenerator.cs