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
- SQLDoubleStorage.cs
- SqlXmlStorage.cs
- GridViewCellAutomationPeer.cs
- MetabaseSettingsIis7.cs
- DataGridCommandEventArgs.cs
- XPathAncestorIterator.cs
- InvokeSchedule.cs
- SiteMapHierarchicalDataSourceView.cs
- ClientConvert.cs
- XmlMapping.cs
- TextTreeInsertUndoUnit.cs
- MaterialCollection.cs
- XpsFilter.cs
- XmlDataSource.cs
- ReferentialConstraint.cs
- FormViewModeEventArgs.cs
- BindingsCollection.cs
- CompositeDataBoundControl.cs
- ScriptMethodAttribute.cs
- MonthChangedEventArgs.cs
- IdnMapping.cs
- ProfileParameter.cs
- IndexOutOfRangeException.cs
- DataContractSerializerOperationGenerator.cs
- SQLDateTimeStorage.cs
- DataRelation.cs
- UIElementPropertyUndoUnit.cs
- IgnoreSectionHandler.cs
- Point.cs
- BaseCodePageEncoding.cs
- PriorityRange.cs
- SqlBuilder.cs
- DateTimeStorage.cs
- CodeBlockBuilder.cs
- DocumentCollection.cs
- ServicePrincipalNameElement.cs
- FunctionImportMapping.cs
- ErrorHandlerFaultInfo.cs
- NonVisualControlAttribute.cs
- ListItemCollection.cs
- UMPAttributes.cs
- odbcmetadatacolumnnames.cs
- ComPlusInstanceProvider.cs
- XmlSchemaObjectCollection.cs
- NativeMethodsCLR.cs
- RTLAwareMessageBox.cs
- RoleManagerSection.cs
- Vector3DConverter.cs
- RectIndependentAnimationStorage.cs
- StructuredCompositeActivityDesigner.cs
- SafeLocalMemHandle.cs
- NullRuntimeConfig.cs
- DataGridViewTextBoxColumn.cs
- ValidatedControlConverter.cs
- ImportDesigner.xaml.cs
- HTMLTagNameToTypeMapper.cs
- DoubleAnimationUsingKeyFrames.cs
- TypefaceCollection.cs
- ReferenceEqualityComparer.cs
- PrintEvent.cs
- IndexerNameAttribute.cs
- HelpEvent.cs
- EdmProviderManifest.cs
- Identity.cs
- ScriptReferenceBase.cs
- OleDbError.cs
- OdbcRowUpdatingEvent.cs
- TextEditorDragDrop.cs
- HtmlGenericControl.cs
- HttpApplication.cs
- DateTimeFormat.cs
- ColorMatrix.cs
- UrlSyndicationContent.cs
- ValueProviderWrapper.cs
- Char.cs
- SurrogateChar.cs
- ResourceDescriptionAttribute.cs
- GridViewPageEventArgs.cs
- ImageButton.cs
- ZipIOCentralDirectoryBlock.cs
- RunInstallerAttribute.cs
- Dispatcher.cs
- CommandID.cs
- PasswordRecoveryDesigner.cs
- BorderGapMaskConverter.cs
- DataKey.cs
- WebException.cs
- CodeSnippetCompileUnit.cs
- Debug.cs
- BitVec.cs
- ValidationRule.cs
- RangeValidator.cs
- CryptoApi.cs
- TimestampInformation.cs
- xsdvalidator.cs
- DataServiceRequestException.cs
- WindowPattern.cs
- ProxyWebPartConnectionCollection.cs
- UIElementParagraph.cs
- AlternateViewCollection.cs