Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / LockedHandleGlyph.cs / 1 / LockedHandleGlyph.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 LockedHandleGlyph 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 LockedHandleGlyph : SelectionGlyphBase { private bool isPrimary = false; ////// /// LockedHandleGlyph'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 LockedHandleGlyph(Rectangle controlBounds, bool primarySelection) : base(null) { isPrimary = primarySelection; hitTestCursor = Cursors.Default; rules = SelectionRules.None; bounds = new Rectangle((controlBounds.X + DesignerUtils.LOCKHANDLEOVERLAP) - DesignerUtils.LOCKHANDLEWIDTH, (controlBounds.Y + DesignerUtils.LOCKHANDLEOVERLAP) - DesignerUtils.LOCKHANDLEHEIGHT, DesignerUtils.LOCKHANDLEWIDTH, DesignerUtils.LOCKHANDLEHEIGHT); hitBounds = bounds; } ////// /// Very simple paint logic. /// public override void Paint(PaintEventArgs pe) { DesignerUtils.DrawLockedHandle(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
- HealthMonitoringSectionHelper.cs
- StaticFileHandler.cs
- ReaderWriterLockSlim.cs
- EntityReference.cs
- CursorInteropHelper.cs
- CustomPopupPlacement.cs
- MetadataStore.cs
- Wrapper.cs
- altserialization.cs
- XamlPointCollectionSerializer.cs
- SchemaImporterExtensionElementCollection.cs
- PartialTrustHelpers.cs
- Columns.cs
- FontDifferentiator.cs
- FontWeight.cs
- AuthStoreRoleProvider.cs
- VirtualPathUtility.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- XmlAttributeCache.cs
- CompareValidator.cs
- SettingsPropertyCollection.cs
- HttpModuleCollection.cs
- TextContainerHelper.cs
- RoutedCommand.cs
- FileInfo.cs
- ToolStripMenuItemDesigner.cs
- TextProperties.cs
- ClientTargetCollection.cs
- OperationExecutionFault.cs
- Pair.cs
- XpsDocumentEvent.cs
- MessageQueueConverter.cs
- CommandValueSerializer.cs
- FullTrustAssembliesSection.cs
- SqlOuterApplyReducer.cs
- TabControl.cs
- X509CertificateChain.cs
- Calendar.cs
- CallbackValidator.cs
- PointLightBase.cs
- ReliableSessionBindingElement.cs
- CannotUnloadAppDomainException.cs
- RegularExpressionValidator.cs
- PresentationSource.cs
- SaveFileDialog.cs
- Color.cs
- SiteMapNode.cs
- PeerDuplexChannelListener.cs
- ServiceDescriptionImporter.cs
- SqlRowUpdatingEvent.cs
- CustomBinding.cs
- SelectedDatesCollection.cs
- CodeAttributeArgument.cs
- XmlSerializableReader.cs
- ManifestResourceInfo.cs
- MetadataWorkspace.cs
- JournalEntry.cs
- AttributeSetAction.cs
- SmiRequestExecutor.cs
- DesignerDeviceConfig.cs
- DataRecordInternal.cs
- GreenMethods.cs
- SqlDataSourceCommandEventArgs.cs
- PropertyGridEditorPart.cs
- Inflater.cs
- FederatedMessageSecurityOverHttpElement.cs
- TextBoxLine.cs
- StaticFileHandler.cs
- ClickablePoint.cs
- TextBlock.cs
- IISMapPath.cs
- DataGridViewCellConverter.cs
- SQLDecimal.cs
- GridView.cs
- FilteredDataSetHelper.cs
- Version.cs
- LiteralText.cs
- ToolBarButton.cs
- LZCodec.cs
- ListMarkerSourceInfo.cs
- DelegatedStream.cs
- MetadataItemEmitter.cs
- AddValidationError.cs
- GrammarBuilderRuleRef.cs
- Closure.cs
- XPathQueryGenerator.cs
- DockingAttribute.cs
- HierarchicalDataBoundControl.cs
- SQLDoubleStorage.cs
- InitializerFacet.cs
- TextRenderer.cs
- OleDbDataReader.cs
- TraceLevelHelper.cs
- Console.cs
- WinInetCache.cs
- DockAndAnchorLayout.cs
- SortFieldComparer.cs
- SQLConvert.cs
- MailHeaderInfo.cs
- VectorValueSerializer.cs