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
- TypedTableHandler.cs
- XmlExpressionDumper.cs
- BindingExpressionUncommonField.cs
- PowerStatus.cs
- WebBaseEventKeyComparer.cs
- Image.cs
- MailDefinition.cs
- FixedSOMTextRun.cs
- CfgArc.cs
- SrgsElementList.cs
- AccessibleObject.cs
- AssociationType.cs
- Misc.cs
- BrowserTree.cs
- WebServiceReceiveDesigner.cs
- SqlVisitor.cs
- TaskSchedulerException.cs
- Point3DAnimationUsingKeyFrames.cs
- NullableDoubleAverageAggregationOperator.cs
- PersianCalendar.cs
- ContentTextAutomationPeer.cs
- CharStorage.cs
- AffineTransform3D.cs
- CodeRemoveEventStatement.cs
- ScriptIgnoreAttribute.cs
- SuppressMessageAttribute.cs
- CheckoutException.cs
- AsyncWaitHandle.cs
- RoleManagerEventArgs.cs
- WindowsSecurityTokenAuthenticator.cs
- ISFTagAndGuidCache.cs
- AsyncDataRequest.cs
- FillErrorEventArgs.cs
- InputBinder.cs
- StateChangeEvent.cs
- SerializationHelper.cs
- HtmlAnchor.cs
- DoubleLinkListEnumerator.cs
- ScriptIgnoreAttribute.cs
- MultipartIdentifier.cs
- dsa.cs
- AuthenticationModulesSection.cs
- StrokeIntersection.cs
- XmlSerializerVersionAttribute.cs
- ParameterCollection.cs
- PropertyKey.cs
- ScopeCollection.cs
- LocalizableAttribute.cs
- OdbcReferenceCollection.cs
- FlowStep.cs
- MarkupCompilePass2.cs
- PermissionAttributes.cs
- XmlCompatibilityReader.cs
- QueryStoreStatusRequest.cs
- CodeEntryPointMethod.cs
- FileRecordSequenceCompletedAsyncResult.cs
- EventLogPermissionEntry.cs
- ConfigXmlCDataSection.cs
- MetadataCache.cs
- ParameterToken.cs
- URIFormatException.cs
- WorkflowRuntime.cs
- BitmapEffectGeneralTransform.cs
- WindowsToolbar.cs
- EntityDataSourceContextCreatingEventArgs.cs
- NameTable.cs
- KeyboardNavigation.cs
- Application.cs
- SqlDataSourceRefreshSchemaForm.cs
- InternalSafeNativeMethods.cs
- QueryPrefixOp.cs
- RbTree.cs
- MsmqInputChannelListener.cs
- ButtonBase.cs
- WebPartRestoreVerb.cs
- Rectangle.cs
- QilBinary.cs
- ActivationArguments.cs
- Timer.cs
- ZipFileInfoCollection.cs
- BlurEffect.cs
- XmlSiteMapProvider.cs
- PreservationFileWriter.cs
- ConnectionConsumerAttribute.cs
- SqlTopReducer.cs
- ContainsRowNumberChecker.cs
- LocalClientSecuritySettingsElement.cs
- DesignerTransactionCloseEvent.cs
- ParameterReplacerVisitor.cs
- DefaultBindingPropertyAttribute.cs
- ActivationArguments.cs
- PhysicalFontFamily.cs
- SqlSelectStatement.cs
- sqlstateclientmanager.cs
- baseaxisquery.cs
- AuthenticationConfig.cs
- SiteIdentityPermission.cs
- NameValueConfigurationCollection.cs
- SrgsGrammar.cs
- GroupDescription.cs