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
- MediaTimeline.cs
- UpdateTranslator.cs
- SerializerWriterEventHandlers.cs
- ZeroOpNode.cs
- Math.cs
- XmlArrayAttribute.cs
- Triplet.cs
- ColumnHeader.cs
- HttpResponseInternalWrapper.cs
- PageAsyncTask.cs
- FormViewModeEventArgs.cs
- FormViewPageEventArgs.cs
- IssuanceLicense.cs
- MultipartIdentifier.cs
- TypeFieldSchema.cs
- PackageProperties.cs
- DataGridViewRowsAddedEventArgs.cs
- BitmapEffectCollection.cs
- ObjectDataSourceView.cs
- SystemFonts.cs
- SqlDependencyUtils.cs
- SimpleRecyclingCache.cs
- AspCompat.cs
- PersistenceProviderElement.cs
- XPathMultyIterator.cs
- SpellerError.cs
- HostExecutionContextManager.cs
- ColorConvertedBitmap.cs
- BooleanStorage.cs
- DeploymentSectionCache.cs
- ReadContentAsBinaryHelper.cs
- RandomNumberGenerator.cs
- RegexStringValidator.cs
- Bidi.cs
- Collection.cs
- XmlParserContext.cs
- XmlCollation.cs
- SQLMembershipProvider.cs
- DoubleAnimationClockResource.cs
- storagemappingitemcollection.viewdictionary.cs
- DocumentXPathNavigator.cs
- Control.cs
- ModifierKeysValueSerializer.cs
- ObjectListComponentEditor.cs
- NameTable.cs
- GradientBrush.cs
- MissingManifestResourceException.cs
- ObjectSecurityT.cs
- FixedSOMTableRow.cs
- EmptyCollection.cs
- KeyInstance.cs
- EUCJPEncoding.cs
- BooleanProjectedSlot.cs
- SoapInteropTypes.cs
- HttpCachePolicyElement.cs
- ExtensionWindowHeader.cs
- AttachedPropertyBrowsableAttribute.cs
- OperatingSystemVersionCheck.cs
- EntityDataSourceMemberPath.cs
- UrlAuthorizationModule.cs
- MenuItemStyle.cs
- DiscoveryDocumentSerializer.cs
- DragEventArgs.cs
- FacetEnabledSchemaElement.cs
- TransactionFlowBindingElement.cs
- GenericPrincipal.cs
- ThrowOnMultipleAssignment.cs
- DiscoveryClientReferences.cs
- AssemblyAttributes.cs
- CompiledIdentityConstraint.cs
- UpDownEvent.cs
- followingsibling.cs
- FunctionCommandText.cs
- ControlCachePolicy.cs
- EndPoint.cs
- CodeGenHelper.cs
- JsonDeserializer.cs
- ObjectConverter.cs
- Stack.cs
- GeometryGroup.cs
- Validator.cs
- HttpModuleAction.cs
- ComAdminInterfaces.cs
- WebHttpEndpointElement.cs
- EpmContentDeSerializer.cs
- GradientBrush.cs
- PeerNameRegistration.cs
- AggregationMinMaxHelpers.cs
- IUnknownConstantAttribute.cs
- XmlNodeReader.cs
- ServerValidateEventArgs.cs
- MemberInfoSerializationHolder.cs
- CursorConverter.cs
- BindingCollection.cs
- SerializationTrace.cs
- FrameworkElement.cs
- ResourceDictionaryCollection.cs
- ConnectionOrientedTransportElement.cs
- PropagatorResult.cs
- TabPanel.cs