Code:
/ DotNET / DotNET / 8.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
- MessageSmuggler.cs
- DataBinding.cs
- XmlDocumentSerializer.cs
- RadioButtonFlatAdapter.cs
- SchemeSettingElementCollection.cs
- MetadataItem.cs
- KeyFrames.cs
- TextBoxView.cs
- RegistryPermission.cs
- BufferedStream.cs
- MenuTracker.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- BitmapPalette.cs
- ExtractorMetadata.cs
- ResourcesBuildProvider.cs
- xmlfixedPageInfo.cs
- ResourceContainerWrapper.cs
- ConfigurationFileMap.cs
- ExecutionContext.cs
- ReturnEventArgs.cs
- HtmlTable.cs
- FieldCollectionEditor.cs
- StringExpressionSet.cs
- FacetEnabledSchemaElement.cs
- _BasicClient.cs
- SymbolTable.cs
- TableParagraph.cs
- RecordsAffectedEventArgs.cs
- DataBinding.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- TreeBuilder.cs
- SrgsOneOf.cs
- isolationinterop.cs
- SoapFormatterSinks.cs
- ModifierKeysConverter.cs
- SkipStoryboardToFill.cs
- ChildTable.cs
- StrokeNodeData.cs
- PixelFormat.cs
- IndependentAnimationStorage.cs
- LinearGradientBrush.cs
- NonVisualControlAttribute.cs
- MenuEventArgs.cs
- DataGridViewButtonColumn.cs
- LocationChangedEventArgs.cs
- Int32Rect.cs
- MergeFilterQuery.cs
- CapiSymmetricAlgorithm.cs
- Exceptions.cs
- InternalTypeHelper.cs
- SessionStateSection.cs
- Button.cs
- PreProcessor.cs
- PointValueSerializer.cs
- ParseHttpDate.cs
- CompilationUnit.cs
- TabControl.cs
- ISAPIRuntime.cs
- ListViewGroupConverter.cs
- HttpHeaderCollection.cs
- TemplateLookupAction.cs
- DesignBindingPropertyDescriptor.cs
- HttpModulesInstallComponent.cs
- ItemsControlAutomationPeer.cs
- MSG.cs
- FontConverter.cs
- InputManager.cs
- ModuleElement.cs
- ControlPersister.cs
- ReflectionPermission.cs
- PenThreadPool.cs
- LinqDataSourceDisposeEventArgs.cs
- TableLayout.cs
- MailBnfHelper.cs
- DataGridView.cs
- CompositeControlDesigner.cs
- DataGridViewColumnCollectionDialog.cs
- MarkupObject.cs
- AmbiguousMatchException.cs
- ApplicationFileParser.cs
- ResizeGrip.cs
- ComponentEvent.cs
- IItemProperties.cs
- UInt16Converter.cs
- DefaultPrintController.cs
- WebPartManager.cs
- TabletDevice.cs
- HashHelper.cs
- RegistrationServices.cs
- UrlMappingCollection.cs
- OwnerDrawPropertyBag.cs
- initElementDictionary.cs
- complextypematerializer.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- _MultipleConnectAsync.cs
- RightNameExpirationInfoPair.cs
- Message.cs
- NavigationHelper.cs
- ForceCopyBuildProvider.cs
- GeneratedContractType.cs