Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / NoResizeHandleGlyph.cs / 1 / NoResizeHandleGlyph.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; using System.Runtime.InteropServices; ////// /// The NoResizeHandleGlyph represents the handle for a non-resizeable control in our new seleciton /// model. Note that the pen and brush are created once per instance of this class /// and re-used in our painting logic for perf. reasonse. /// internal class NoResizeHandleGlyph : SelectionGlyphBase { private bool isPrimary = false; ////// /// NoResizeHandleGlyph's constructor takes additional parameters: 'type' and 'primary selection'. /// Also, we create/cache our pen & brush here to avoid this action with every paint message. /// internal NoResizeHandleGlyph(Rectangle controlBounds, SelectionRules selRules, bool primarySelection, Behavior behavior) : base(behavior) { isPrimary = primarySelection; hitTestCursor = Cursors.Default; rules = SelectionRules.None; if ((selRules & SelectionRules.Moveable) != 0) { rules = SelectionRules.Moveable; hitTestCursor = Cursors.SizeAll; } // The handle is always upperleft bounds = new Rectangle(controlBounds.X - DesignerUtils.NORESIZEHANDLESIZE, controlBounds.Y - DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE); hitBounds = bounds; } ////// /// Very simple paint logic. /// public override void Paint(PaintEventArgs pe) { DesignerUtils.DrawNoResizeHandle(pe.Graphics, bounds, isPrimary, this); } } } // 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
- PointKeyFrameCollection.cs
- EncodingTable.cs
- EditorOptionAttribute.cs
- ScrollChangedEventArgs.cs
- StylusDownEventArgs.cs
- EventSinkActivity.cs
- RemoteWebConfigurationHostStream.cs
- InkCanvasSelectionAdorner.cs
- SortDescription.cs
- PropertyCondition.cs
- CodeDomSerializer.cs
- AppDomainManager.cs
- KoreanCalendar.cs
- _MultipleConnectAsync.cs
- XmlStreamedByteStreamReader.cs
- XmlObjectSerializerContext.cs
- MessageBox.cs
- PermissionSetEnumerator.cs
- XmlKeywords.cs
- RangeValuePatternIdentifiers.cs
- ConfigPathUtility.cs
- DocumentXmlWriter.cs
- DecimalConstantAttribute.cs
- DispatcherProcessingDisabled.cs
- WebPartZoneAutoFormat.cs
- HostSecurityManager.cs
- RowsCopiedEventArgs.cs
- Registry.cs
- XsltArgumentList.cs
- Pair.cs
- MarkupWriter.cs
- EncoderExceptionFallback.cs
- IERequestCache.cs
- DataGridColumnCollectionEditor.cs
- DefinitionUpdate.cs
- XPathBinder.cs
- DocumentPaginator.cs
- ExceptionValidationRule.cs
- ToolStripSplitStackLayout.cs
- SQLSingleStorage.cs
- CdpEqualityComparer.cs
- TemplateBuilder.cs
- IsolatedStorageException.cs
- WindowsAuthenticationEventArgs.cs
- AtlasWeb.Designer.cs
- ModifierKeysConverter.cs
- ConstantExpression.cs
- HttpCacheVary.cs
- AssertFilter.cs
- ReadOnlyHierarchicalDataSourceView.cs
- OSEnvironmentHelper.cs
- SmiEventSink.cs
- MorphHelper.cs
- CompilerTypeWithParams.cs
- HtmlInputControl.cs
- IDictionary.cs
- FixedTextContainer.cs
- BigInt.cs
- ResolveNameEventArgs.cs
- VectorAnimationBase.cs
- WebServiceErrorEvent.cs
- FixedBufferAttribute.cs
- AppDomain.cs
- Byte.cs
- DragCompletedEventArgs.cs
- IntegrationExceptionEventArgs.cs
- Type.cs
- IDReferencePropertyAttribute.cs
- CombinedGeometry.cs
- Byte.cs
- SubstitutionResponseElement.cs
- MILUtilities.cs
- IODescriptionAttribute.cs
- CodeExpressionCollection.cs
- IProducerConsumerCollection.cs
- HttpHandler.cs
- SamlAuthenticationClaimResource.cs
- CodeConditionStatement.cs
- UpdatePanelTriggerCollection.cs
- StringArrayConverter.cs
- SQLRoleProvider.cs
- VectorAnimationUsingKeyFrames.cs
- TextRange.cs
- WebPartMenu.cs
- PageThemeBuildProvider.cs
- Application.cs
- RolePrincipal.cs
- FormViewAutoFormat.cs
- SqlStatistics.cs
- EllipticalNodeOperations.cs
- ByteStorage.cs
- UrlMapping.cs
- MenuAutomationPeer.cs
- DoubleIndependentAnimationStorage.cs
- mactripleDES.cs
- RuntimeArgumentHandle.cs
- UpdateRecord.cs
- XmlSchemaAny.cs
- DocumentSequence.cs
- RSAPKCS1KeyExchangeDeformatter.cs