Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / LockedBorderGlyph.cs / 1 / LockedBorderGlyph.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 LockedBorderGlyph : SelectionGlyphBase {
///
///
/// 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 LockedBorderGlyph(Rectangle controlBounds, SelectionBorderGlyphType type) : base(null) {
InitializeGlyph(controlBounds, type);
}
///
/// Helper function that initializes the Glyph based on bounds, type, primary sel, and bordersize.
///
private void InitializeGlyph(Rectangle controlBounds, SelectionBorderGlyphType type) {
hitTestCursor = Cursors.Default;//always default cursor for locked
rules = SelectionRules.None;//never change sel rules for locked
//this will return the rect representing the bounds of the glyph
bounds = DesignerUtils.GetBoundsForSelectionType(controlBounds, type);
hitBounds = bounds;
}
///
///
/// Simple painting logic for locked Glyphs.
///
public override void Paint(PaintEventArgs pe) {
DesignerUtils.DrawSelectionBorder(pe.Graphics, 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
- BitmapEffectInput.cs
- Pair.cs
- ImportOptions.cs
- WindowsListViewItemCheckBox.cs
- InnerItemCollectionView.cs
- ComboBoxAutomationPeer.cs
- XmlSubtreeReader.cs
- DeferredElementTreeState.cs
- IndexedString.cs
- CommandLineParser.cs
- FlowDocumentFormatter.cs
- Oid.cs
- WebSysDescriptionAttribute.cs
- ClientSponsor.cs
- CorrelationService.cs
- RegexGroupCollection.cs
- SapiRecoInterop.cs
- SemaphoreSecurity.cs
- DesignerSerializationOptionsAttribute.cs
- DispatcherHookEventArgs.cs
- TdsParameterSetter.cs
- LogicalExpressionTypeConverter.cs
- InternalBase.cs
- WebPartsPersonalization.cs
- SuppressIldasmAttribute.cs
- DataSourceSelectArguments.cs
- X509ClientCertificateAuthentication.cs
- GlyphCollection.cs
- PropertyValueChangedEvent.cs
- Accessible.cs
- SimpleFieldTemplateFactory.cs
- CategoryList.cs
- FunctionQuery.cs
- SecureUICommand.cs
- WindowsAltTab.cs
- DefaultBinder.cs
- ObjectItemCollection.cs
- WindowsFont.cs
- AuthStoreRoleProvider.cs
- InputMethodStateTypeInfo.cs
- ParserHooks.cs
- DetailsViewUpdateEventArgs.cs
- FtpCachePolicyElement.cs
- TextEditorSelection.cs
- FormatterServices.cs
- AbsoluteQuery.cs
- SwitchElementsCollection.cs
- TransformedBitmap.cs
- TypeNameConverter.cs
- Attribute.cs
- _ConnectStream.cs
- EntryWrittenEventArgs.cs
- Mapping.cs
- Point3DCollectionConverter.cs
- FormatConvertedBitmap.cs
- ContentTextAutomationPeer.cs
- EventPropertyMap.cs
- SpotLight.cs
- SqlSelectStatement.cs
- DynamicUpdateCommand.cs
- SqlServer2KCompatibilityCheck.cs
- NetTcpBindingElement.cs
- MouseOverProperty.cs
- AnimationLayer.cs
- LayoutEvent.cs
- NonBatchDirectoryCompiler.cs
- AuthenticationConfig.cs
- RouteParameter.cs
- SeekStoryboard.cs
- WebHeaderCollection.cs
- SqlNodeAnnotation.cs
- ParameterExpression.cs
- FilteredSchemaElementLookUpTable.cs
- DetailsViewInsertEventArgs.cs
- TextFormattingConverter.cs
- CodeComment.cs
- ConditionalAttribute.cs
- UnaryExpression.cs
- FileUpload.cs
- TokenizerHelper.cs
- SiteMapHierarchicalDataSourceView.cs
- MediaElementAutomationPeer.cs
- CommandBinding.cs
- WebWorkflowRole.cs
- HtmlHead.cs
- GeometryValueSerializer.cs
- MergeFailedEvent.cs
- XPathNodeIterator.cs
- AlternateView.cs
- CachedTypeface.cs
- WindowsRegion.cs
- RegexWorker.cs
- Vector3DValueSerializer.cs
- Effect.cs
- CommandBindingCollection.cs
- DrawingContextDrawingContextWalker.cs
- TextRangeBase.cs
- JapaneseLunisolarCalendar.cs
- RoutedCommand.cs
- FigureParaClient.cs