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
- FormParameter.cs
- UserControlParser.cs
- HttpListenerContext.cs
- TextBox.cs
- CodeTypeMemberCollection.cs
- Viewport3DAutomationPeer.cs
- CodePageUtils.cs
- DtdParser.cs
- MultilineStringEditor.cs
- Select.cs
- TextSerializer.cs
- MimeXmlReflector.cs
- TypeUnloadedException.cs
- DBConnection.cs
- ThreadInterruptedException.cs
- ScrollEvent.cs
- TransformedBitmap.cs
- ToolStripSeparator.cs
- UniformGrid.cs
- HttpWriter.cs
- WriteableOnDemandPackagePart.cs
- XNodeNavigator.cs
- SqlDataSourceView.cs
- HttpServerVarsCollection.cs
- CryptoConfig.cs
- SecurityTokenProvider.cs
- TagNameToTypeMapper.cs
- PropertyValue.cs
- ValidatorCollection.cs
- DoubleAnimationClockResource.cs
- VirtualPathUtility.cs
- UpDownBase.cs
- UnconditionalPolicy.cs
- compensatingcollection.cs
- StateWorkerRequest.cs
- SymbolDocumentGenerator.cs
- SynchronizedReadOnlyCollection.cs
- VirtualPathProvider.cs
- Range.cs
- Win32Native.cs
- Exceptions.cs
- IDispatchConstantAttribute.cs
- KnownColorTable.cs
- FrameworkElement.cs
- InputLanguageProfileNotifySink.cs
- TextRunCacheImp.cs
- HttpModuleAction.cs
- MetadataUtil.cs
- PropertyState.cs
- ImageField.cs
- ObjectMaterializedEventArgs.cs
- LambdaCompiler.Logical.cs
- BrushMappingModeValidation.cs
- Size.cs
- FollowerQueueCreator.cs
- AnimationStorage.cs
- prompt.cs
- ProfileGroupSettings.cs
- NavigateEvent.cs
- SymmetricAlgorithm.cs
- ToolStripDropDownClosingEventArgs.cs
- WebPartTransformerAttribute.cs
- WS2007HttpBindingElement.cs
- RuntimeResourceSet.cs
- SqlNotificationRequest.cs
- TextElementCollection.cs
- GetIndexBinder.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- FragmentQuery.cs
- ToolTip.cs
- CodeGen.cs
- Thumb.cs
- RelatedCurrencyManager.cs
- ToggleButtonAutomationPeer.cs
- RangeBase.cs
- SQLRoleProvider.cs
- QueryPageSettingsEventArgs.cs
- HttpDictionary.cs
- DefaultValueConverter.cs
- BulletChrome.cs
- Header.cs
- Vector3DCollection.cs
- OleCmdHelper.cs
- MsmqBindingMonitor.cs
- FilterElement.cs
- CornerRadius.cs
- StylusButtonCollection.cs
- HttpSessionStateBase.cs
- JsonEnumDataContract.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- CellTreeNodeVisitors.cs
- Symbol.cs
- TreeChangeInfo.cs
- CustomError.cs
- SendSecurityHeader.cs
- XmlSchemaComplexContentRestriction.cs
- RuleInfoComparer.cs
- NamedPipeDuplicateContext.cs
- FormConverter.cs
- DefaultShape.cs