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
- SizeAnimationClockResource.cs
- UndoManager.cs
- XmlWrappingReader.cs
- XmlReflectionImporter.cs
- ValidatorAttribute.cs
- DataGridViewEditingControlShowingEventArgs.cs
- HttpListenerRequest.cs
- XPathNodeInfoAtom.cs
- PartManifestEntry.cs
- ZoneLinkButton.cs
- cookie.cs
- HttpConfigurationSystem.cs
- SqlAggregateChecker.cs
- EndpointAddressElementBase.cs
- NetTcpSectionData.cs
- _SecureChannel.cs
- VersionedStreamOwner.cs
- CodePageEncoding.cs
- CodeMemberField.cs
- CoTaskMemHandle.cs
- HtmlMeta.cs
- UriTemplateTrieNode.cs
- DeobfuscatingStream.cs
- MemberDescriptor.cs
- WebPartManager.cs
- ErrorStyle.cs
- Sql8ExpressionRewriter.cs
- ContractListAdapter.cs
- StateMachine.cs
- PersonalizationAdministration.cs
- WindowsIdentity.cs
- RepeaterItem.cs
- CompilationSection.cs
- MatrixCamera.cs
- Listbox.cs
- DbCommandDefinition.cs
- SqlStream.cs
- QueryAccessibilityHelpEvent.cs
- LocationEnvironment.cs
- ValidatorUtils.cs
- LinqTreeNodeEvaluator.cs
- EventLogPermission.cs
- ParentQuery.cs
- TextSchema.cs
- VerticalAlignConverter.cs
- CipherData.cs
- MimeTypeMapper.cs
- PolicyException.cs
- UnsafeNativeMethods.cs
- Context.cs
- AuthenticationService.cs
- _Rfc2616CacheValidators.cs
- XmlWriterTraceListener.cs
- DictionaryEditChange.cs
- VectorConverter.cs
- StylusPlugin.cs
- SqlBulkCopyColumnMapping.cs
- SerializerWriterEventHandlers.cs
- RequiredAttributeAttribute.cs
- DockingAttribute.cs
- Decorator.cs
- InvalidDataContractException.cs
- HtmlControlPersistable.cs
- NamespaceMapping.cs
- Array.cs
- DataGridViewDataErrorEventArgs.cs
- ConfigXmlComment.cs
- WindowsIdentity.cs
- AlignmentYValidation.cs
- GenericPrincipal.cs
- TemplateKey.cs
- BitmapSource.cs
- WhitespaceRule.cs
- PermissionAttributes.cs
- Transactions.cs
- Utils.cs
- AssemblyHash.cs
- ModifierKeysValueSerializer.cs
- GiveFeedbackEvent.cs
- TokenBasedSetEnumerator.cs
- updateconfighost.cs
- WebPartCloseVerb.cs
- Clock.cs
- DateTimeFormatInfoScanner.cs
- ResourceDictionaryCollection.cs
- ArcSegment.cs
- DBSchemaTable.cs
- ConnectionManagementElement.cs
- AutomationElementCollection.cs
- TableLayoutSettings.cs
- Literal.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ContractNamespaceAttribute.cs
- TemplateControlBuildProvider.cs
- TraceRecord.cs
- SizeIndependentAnimationStorage.cs
- ToolStripDropDownItem.cs
- OutputBuffer.cs
- NamespaceMapping.cs
- UrlAuthFailureHandler.cs