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
- ToolStripContentPanelRenderEventArgs.cs
- DtdParser.cs
- TimerElapsedEvenArgs.cs
- PrivilegeNotHeldException.cs
- ClientTarget.cs
- DrawingDrawingContext.cs
- TextEndOfSegment.cs
- Atom10FeedFormatter.cs
- MessageQueueKey.cs
- ActivityExecutorSurrogate.cs
- SelectionRange.cs
- DataServiceHost.cs
- SqlDelegatedTransaction.cs
- _Rfc2616CacheValidators.cs
- TimeZone.cs
- VBCodeProvider.cs
- XmlNodeChangedEventArgs.cs
- AuthenticationService.cs
- DefaultSection.cs
- Html32TextWriter.cs
- AssemblyCollection.cs
- CFStream.cs
- QilLiteral.cs
- adornercollection.cs
- COM2ComponentEditor.cs
- AnimationTimeline.cs
- CustomAssemblyResolver.cs
- PeerNearMe.cs
- ZipIOCentralDirectoryBlock.cs
- ClientApiGenerator.cs
- UrlMappingsModule.cs
- Normalization.cs
- Icon.cs
- RegistrationServices.cs
- Misc.cs
- ExceptionUtil.cs
- StringFunctions.cs
- PathStreamGeometryContext.cs
- SymbolPair.cs
- DirectoryObjectSecurity.cs
- WebResponse.cs
- PackUriHelper.cs
- DataTemplateSelector.cs
- GlyphingCache.cs
- GroupItemAutomationPeer.cs
- Mouse.cs
- EventData.cs
- BamlWriter.cs
- ClockGroup.cs
- ResourcePool.cs
- SecurityMode.cs
- DelegateBodyWriter.cs
- BamlRecordWriter.cs
- DataSourceView.cs
- Color.cs
- HttpDictionary.cs
- RSAPKCS1KeyExchangeFormatter.cs
- versioninfo.cs
- FormatterConverter.cs
- DirectoryInfo.cs
- xmlsaver.cs
- MULTI_QI.cs
- CultureSpecificStringDictionary.cs
- KeyValueSerializer.cs
- WmpBitmapDecoder.cs
- Viewport3DVisual.cs
- HttpDictionary.cs
- FindCriteriaElement.cs
- MultiAsyncResult.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ScriptManager.cs
- FontCacheUtil.cs
- EmbeddedMailObject.cs
- ListBoxChrome.cs
- ValidateNames.cs
- StructuredTypeEmitter.cs
- HttpListener.cs
- CngProperty.cs
- SendKeys.cs
- IntegerValidatorAttribute.cs
- GeometryValueSerializer.cs
- FieldNameLookup.cs
- Matrix.cs
- DataSvcMapFile.cs
- XmlWrappingReader.cs
- ProgressChangedEventArgs.cs
- IdentifierCollection.cs
- ExpressionBindingCollection.cs
- Pen.cs
- VScrollProperties.cs
- MetadataCollection.cs
- HttpDebugHandler.cs
- DataGridViewLinkCell.cs
- HttpSocketManager.cs
- HttpResponseHeader.cs
- SynchronizationLockException.cs
- Array.cs
- MessageContractAttribute.cs
- DoubleCollection.cs
- SafeBitVector32.cs