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
- ConfigPathUtility.cs
- WSDualHttpSecurity.cs
- CqlQuery.cs
- PasswordRecovery.cs
- PathSegment.cs
- GuidelineSet.cs
- ipaddressinformationcollection.cs
- ObjectDataSourceStatusEventArgs.cs
- CancellationTokenSource.cs
- CryptoKeySecurity.cs
- ProcessHost.cs
- WebPartConnectVerb.cs
- XmlObjectSerializerReadContextComplex.cs
- SortDescriptionCollection.cs
- PersonalizationStateInfoCollection.cs
- DragAssistanceManager.cs
- ApplicationFileParser.cs
- DelegatedStream.cs
- StrongNameUtility.cs
- WebPartRestoreVerb.cs
- AVElementHelper.cs
- sqlnorm.cs
- ButtonFieldBase.cs
- LocalBuilder.cs
- ProfileManager.cs
- WindowsFormsEditorServiceHelper.cs
- HttpRequestCacheValidator.cs
- Internal.cs
- ReachSerializationUtils.cs
- DictionarySectionHandler.cs
- DbDataAdapter.cs
- DataGridViewLinkColumn.cs
- FontInfo.cs
- DataRelationPropertyDescriptor.cs
- ThicknessAnimationUsingKeyFrames.cs
- ExtendedProperty.cs
- DbModificationClause.cs
- XsltContext.cs
- AccessViolationException.cs
- DesignerTransaction.cs
- TransactionTable.cs
- ProxyWebPartManagerDesigner.cs
- PieceDirectory.cs
- SocketManager.cs
- SerialErrors.cs
- SqlError.cs
- CellPartitioner.cs
- InputEventArgs.cs
- StringHelper.cs
- SortedDictionary.cs
- util.cs
- ThaiBuddhistCalendar.cs
- odbcmetadatafactory.cs
- TextSearch.cs
- ResourceDisplayNameAttribute.cs
- CannotUnloadAppDomainException.cs
- WebControlParameterProxy.cs
- Script.cs
- RemotingConfigParser.cs
- NotFiniteNumberException.cs
- StylusEditingBehavior.cs
- AdCreatedEventArgs.cs
- PersonalizableTypeEntry.cs
- RuntimeIdentifierPropertyAttribute.cs
- EqualityComparer.cs
- StreamSecurityUpgradeProvider.cs
- ToolStripDropDownButton.cs
- ConcurrentQueue.cs
- LoginViewDesigner.cs
- AutomationEvent.cs
- AppDomainFactory.cs
- FusionWrap.cs
- SmiConnection.cs
- AttributeConverter.cs
- CssClassPropertyAttribute.cs
- sortedlist.cs
- DocumentSchemaValidator.cs
- MessageBox.cs
- NullableFloatSumAggregationOperator.cs
- TypeDescriptionProviderAttribute.cs
- TypeReference.cs
- TaskFormBase.cs
- WorkItem.cs
- EntityExpressionVisitor.cs
- WindowsAuthenticationModule.cs
- LineUtil.cs
- CompilerGlobalScopeAttribute.cs
- SessionStateItemCollection.cs
- XmlCharCheckingWriter.cs
- TableRowCollection.cs
- COMException.cs
- HtmlInputRadioButton.cs
- Attachment.cs
- TemplateColumn.cs
- WorkflowOperationBehavior.cs
- TextPenaltyModule.cs
- SwitchElementsCollection.cs
- LineGeometry.cs
- CachingHintValidation.cs
- SqlBinder.cs