Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / BodyGlyph.cs / 1 / BodyGlyph.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; ////// /// This Glyph is placed on every control sized to the exact bounds of /// the control. /// public class ControlBodyGlyph : ComponentGlyph { private Rectangle bounds; //bounds of the related control private Cursor hitTestCursor; //cursor used to hit test private IComponent component; ////// /// Standard Constructor. /// public ControlBodyGlyph(Rectangle bounds, Cursor cursor, IComponent relatedComponent, ControlDesigner designer) : base(relatedComponent, new ControlDesigner.TransparentBehavior(designer)) { this.bounds = bounds; this.hitTestCursor = cursor; this.component = relatedComponent; } public ControlBodyGlyph(Rectangle bounds, Cursor cursor, IComponent relatedComponent, Behavior behavior) : base(relatedComponent, behavior) { this.bounds = bounds; this.hitTestCursor = cursor; this.component = relatedComponent; } ////// /// Simple hit test rule: if the point is contained within the bounds /// AND the component is Visible (controls on some tab pages may /// not be, for ex) then it is a positive hit test. /// public override Cursor GetHitTest(Point p) { bool isVisible = (component is Control) ? ((Control)component).Visible : true; /*non-controls are always visible here*/ if (isVisible && bounds.Contains(p)) { return hitTestCursor; } return null; } ////// /// The bounds of this glyph. /// public override Rectangle Bounds { get { return 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
- FrameworkTemplate.cs
- RuntimeUtils.cs
- Validator.cs
- COSERVERINFO.cs
- ValidationResult.cs
- TextHidden.cs
- SqlException.cs
- ColumnMap.cs
- TaskFormBase.cs
- XPathExpr.cs
- ExcCanonicalXml.cs
- EntityDataSourceConfigureObjectContext.cs
- WebConfigurationManager.cs
- SelectingProviderEventArgs.cs
- IfAction.cs
- ContentPosition.cs
- SqlExpander.cs
- HealthMonitoringSection.cs
- InkPresenterAutomationPeer.cs
- Win32NamedPipes.cs
- XamlHostingConfiguration.cs
- ObjectDisposedException.cs
- MaterialGroup.cs
- StateChangeEvent.cs
- InstanceKeyNotReadyException.cs
- ClientTarget.cs
- VersionConverter.cs
- ConstrainedDataObject.cs
- VectorAnimationUsingKeyFrames.cs
- List.cs
- CodeDelegateInvokeExpression.cs
- TreeBuilder.cs
- TreeNodeCollection.cs
- DesignerActionUIService.cs
- EntityTypeBase.cs
- WindowHideOrCloseTracker.cs
- SubclassTypeValidator.cs
- BasicHttpMessageSecurityElement.cs
- embossbitmapeffect.cs
- Blend.cs
- ExpandCollapseIsCheckedConverter.cs
- HandlerMappingMemo.cs
- BuildDependencySet.cs
- AccessDataSourceWizardForm.cs
- AttributeCollection.cs
- HttpModuleAction.cs
- GradientBrush.cs
- DataListCommandEventArgs.cs
- LiteralDesigner.cs
- BitmapEffectInputData.cs
- Symbol.cs
- ResourceDescriptionAttribute.cs
- PolyBezierSegmentFigureLogic.cs
- UIServiceHelper.cs
- StylusDevice.cs
- Collection.cs
- ServerIdentity.cs
- WindowsGraphics2.cs
- BaseTemplatedMobileComponentEditor.cs
- Directory.cs
- CryptoStream.cs
- ObjectPersistData.cs
- ObjectDataSourceSelectingEventArgs.cs
- Attributes.cs
- SafeThemeHandle.cs
- SortAction.cs
- CngAlgorithm.cs
- Themes.cs
- RewritingValidator.cs
- DmlSqlGenerator.cs
- GetChildSubtree.cs
- SqlClientWrapperSmiStream.cs
- NavigatorOutput.cs
- SqlServices.cs
- ListenerTraceUtility.cs
- MappingSource.cs
- DesignerHost.cs
- MergablePropertyAttribute.cs
- SemanticKeyElement.cs
- _SSPISessionCache.cs
- NCryptSafeHandles.cs
- EncoderReplacementFallback.cs
- TextViewDesigner.cs
- ClientScriptManager.cs
- transactioncontext.cs
- TextServicesLoader.cs
- StylusLogic.cs
- MessageHeaderDescriptionCollection.cs
- GZipDecoder.cs
- MenuEventArgs.cs
- HtmlLink.cs
- PerformanceCounterPermissionEntry.cs
- TextCollapsingProperties.cs
- PartDesigner.cs
- AttributeQuery.cs
- ValidationSummary.cs
- ByteAnimation.cs
- TextRangeEditLists.cs
- XmlObjectSerializerWriteContext.cs
- SimpleWebHandlerParser.cs