Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / MiniLockedBorderGlyph.cs / 1 / MiniLockedBorderGlyph.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; ////// /// The LockedBorderGlyph draws one side (depending on type) of a SelectionBorder /// in the 'Locked' mode. The constructor will initialize and cache the pen /// and brush objects to avoid uneccessary recreations. /// internal class MiniLockedBorderGlyph : SelectionGlyphBase { private SelectionBorderGlyphType type; ////// /// This constructor extends from the standard SelectionGlyphBase constructor. Note that /// a primarySelection flag is passed in - this will be used when determining the colors /// of the borders. /// internal MiniLockedBorderGlyph(Rectangle controlBounds, SelectionBorderGlyphType type, Behavior behavior, bool primarySelection) : base(behavior) { InitializeGlyph(controlBounds, type, primarySelection); } ////// Helper function that initializes the Glyph based on bounds, type, primary sel, and bordersize. /// private void InitializeGlyph(Rectangle controlBounds, SelectionBorderGlyphType type, bool primarySelection) { hitTestCursor = Cursors.Default;//always default cursor for locked rules = SelectionRules.None;//never change sel rules for locked int borderSize = 1; this.type = type; //this will return the rect representing the bounds of the glyph bounds = DesignerUtils.GetBoundsForSelectionType(controlBounds, type, borderSize); hitBounds = bounds; } ////// /// Simple painting logic for locked Glyphs. /// public override void Paint(PaintEventArgs pe) { //DesignerUtils.DrawSelectionBorder(pe.Graphics, bounds); pe.Graphics.FillRectangle(Brushes.Black, bounds); } } } // 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
- Publisher.cs
- GlyphTypeface.cs
- CatalogPartCollection.cs
- OdbcUtils.cs
- COM2IDispatchConverter.cs
- InvalidPropValue.cs
- ResourceContainerWrapper.cs
- EncoderExceptionFallback.cs
- AggregateNode.cs
- CacheDependency.cs
- Trace.cs
- TrueReadOnlyCollection.cs
- IdentityHolder.cs
- RegionInfo.cs
- MouseDevice.cs
- ItemCollection.cs
- DataStreamFromComStream.cs
- LinqDataSourceDisposeEventArgs.cs
- ValidationService.cs
- Compiler.cs
- AutomationElement.cs
- HwndAppCommandInputProvider.cs
- SchemaTypeEmitter.cs
- GridView.cs
- IssuedTokenClientBehaviorsElementCollection.cs
- PixelFormat.cs
- BinaryExpression.cs
- VersionConverter.cs
- ApplicationProxyInternal.cs
- Visual3D.cs
- URIFormatException.cs
- OleDbRowUpdatingEvent.cs
- MSG.cs
- InputBindingCollection.cs
- InkCanvasFeedbackAdorner.cs
- DBAsyncResult.cs
- DependsOnAttribute.cs
- XmlSchemaAttributeGroup.cs
- TreeNodeCollection.cs
- StylusCollection.cs
- UnsafeNativeMethodsCLR.cs
- BrowserDefinitionCollection.cs
- ArgumentNullException.cs
- PeerDefaultCustomResolverClient.cs
- PropertyPanel.cs
- MouseDevice.cs
- TreeView.cs
- WindowsTreeView.cs
- ShapingWorkspace.cs
- ClientConfigurationHost.cs
- MetadataCache.cs
- UIElement3D.cs
- ResourcePermissionBase.cs
- DataGridViewColumn.cs
- PassportIdentity.cs
- IdentityModelStringsVersion1.cs
- UniqueCodeIdentifierScope.cs
- ToolStripSettings.cs
- LeaseManager.cs
- Image.cs
- CqlParser.cs
- BaseCollection.cs
- SymDocumentType.cs
- ExpanderAutomationPeer.cs
- WindowsEditBoxRange.cs
- DispatchChannelSink.cs
- StrokeCollectionDefaultValueFactory.cs
- SQLUtility.cs
- SecurityResources.cs
- ThreadAttributes.cs
- TextViewSelectionProcessor.cs
- loginstatus.cs
- Grammar.cs
- NonVisualControlAttribute.cs
- XmlValidatingReader.cs
- AbandonedMutexException.cs
- SqlAliaser.cs
- GridSplitter.cs
- TraceListener.cs
- CollectionViewSource.cs
- connectionpool.cs
- HtmlInputImage.cs
- TextFindEngine.cs
- LostFocusEventManager.cs
- ObfuscateAssemblyAttribute.cs
- KeyValueConfigurationElement.cs
- GetRecipientRequest.cs
- KeySpline.cs
- ThreadStaticAttribute.cs
- ListViewCancelEventArgs.cs
- SafeBitVector32.cs
- DESCryptoServiceProvider.cs
- AuthorizationContext.cs
- TextElementEnumerator.cs
- BitmapFrameDecode.cs
- TailCallAnalyzer.cs
- SmtpNtlmAuthenticationModule.cs
- DefaultTextStoreTextComposition.cs
- DrawingState.cs
- ToolStripLocationCancelEventArgs.cs