Code:
/ DotNET / DotNET / 8.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
- CollectionView.cs
- UserControlCodeDomTreeGenerator.cs
- OleCmdHelper.cs
- CuspData.cs
- GenericPrincipal.cs
- ObfuscationAttribute.cs
- PartialCachingAttribute.cs
- CodeTypeMemberCollection.cs
- x509utils.cs
- CustomAttributeSerializer.cs
- MouseEventArgs.cs
- DES.cs
- Rotation3DAnimationBase.cs
- DefaultValueAttribute.cs
- GetCertificateRequest.cs
- RadioButton.cs
- DataStreamFromComStream.cs
- ComponentDispatcher.cs
- LinkedResource.cs
- ConfigurationElementCollection.cs
- StorageEntityContainerMapping.cs
- RecipientInfo.cs
- Identity.cs
- FlowDocumentPaginator.cs
- CharAnimationUsingKeyFrames.cs
- ValidatingReaderNodeData.cs
- GroupItemAutomationPeer.cs
- DomNameTable.cs
- UrlMappingsSection.cs
- Effect.cs
- TextServicesPropertyRanges.cs
- WorkflowViewManager.cs
- SamlAuthorizationDecisionClaimResource.cs
- SoapHeaderAttribute.cs
- FullTrustAssembly.cs
- DelegateTypeInfo.cs
- XmlUtil.cs
- SelectionEditor.cs
- DesignTimeData.cs
- Exceptions.cs
- Propagator.JoinPropagator.cs
- AdornerLayer.cs
- TagPrefixAttribute.cs
- X509Extension.cs
- PropertyChangedEventManager.cs
- XmlNamedNodeMap.cs
- TextWriterTraceListener.cs
- OracleCommand.cs
- TypeHelper.cs
- ConfigurationStrings.cs
- ImageListImageEditor.cs
- FactoryGenerator.cs
- ParserExtension.cs
- ActiveXContainer.cs
- ConfigurationPermission.cs
- FixedSOMPageConstructor.cs
- ContextStaticAttribute.cs
- CaretElement.cs
- SingleAnimation.cs
- XmlSchemaSimpleType.cs
- XmlDataSourceView.cs
- Stroke.cs
- TextChangedEventArgs.cs
- CompensateDesigner.cs
- DocumentViewerConstants.cs
- MembershipValidatePasswordEventArgs.cs
- Label.cs
- Rotation3DAnimationUsingKeyFrames.cs
- DataGridTablesFactory.cs
- SmiTypedGetterSetter.cs
- ActivityCompletionCallbackWrapper.cs
- ObfuscateAssemblyAttribute.cs
- CrossSiteScriptingValidation.cs
- OdbcInfoMessageEvent.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- Rotation3DAnimationBase.cs
- CrossSiteScriptingValidation.cs
- ConsumerConnectionPointCollection.cs
- KeyValuePair.cs
- SecurityTokenSerializer.cs
- Point4D.cs
- EndpointConfigContainer.cs
- SqlNotificationEventArgs.cs
- MapPathBasedVirtualPathProvider.cs
- TraceContext.cs
- FrameworkReadOnlyPropertyMetadata.cs
- Dictionary.cs
- OrderByBuilder.cs
- RootProfilePropertySettingsCollection.cs
- TextCompositionManager.cs
- AmbientLight.cs
- FrameworkElement.cs
- ITextView.cs
- ToolStripLocationCancelEventArgs.cs
- SerializationUtilities.cs
- BulletedList.cs
- Highlights.cs
- XmlSchemaType.cs
- QueryPageSettingsEventArgs.cs
- StringAnimationBase.cs