Code:
/ FX-1434 / FX-1434 / 1.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
- TextBoxView.cs
- WindowsRegion.cs
- SystemResourceKey.cs
- QuaternionAnimationUsingKeyFrames.cs
- DBCommand.cs
- DataControlLinkButton.cs
- SendKeys.cs
- WorkflowServiceHostFactory.cs
- StickyNoteContentControl.cs
- MatrixUtil.cs
- SeverityFilter.cs
- Label.cs
- AnimationException.cs
- ControlCollection.cs
- CompModSwitches.cs
- CompiledRegexRunner.cs
- DataTableMappingCollection.cs
- TabControlDesigner.cs
- ToolStripSplitStackLayout.cs
- StringDictionary.cs
- EtwTrace.cs
- TypedOperationInfo.cs
- TextEncodedRawTextWriter.cs
- DecimalAnimationUsingKeyFrames.cs
- StyleHelper.cs
- Geometry.cs
- MouseOverProperty.cs
- Native.cs
- Identity.cs
- COM2TypeInfoProcessor.cs
- LogSwitch.cs
- ContextStaticAttribute.cs
- QuaternionRotation3D.cs
- dbdatarecord.cs
- MissingMemberException.cs
- SrgsDocumentParser.cs
- BrushMappingModeValidation.cs
- HtmlInputHidden.cs
- WebRequest.cs
- RelationshipManager.cs
- DesignTimeVisibleAttribute.cs
- TdsParserStateObject.cs
- Label.cs
- Suspend.cs
- Popup.cs
- UInt32Storage.cs
- XmlSchemaComplexContentExtension.cs
- IRCollection.cs
- SessionStateContainer.cs
- WebPartChrome.cs
- ColumnBinding.cs
- WindowsGraphicsCacheManager.cs
- SystemIcmpV4Statistics.cs
- XmlUtil.cs
- DeferredElementTreeState.cs
- OleDbConnectionInternal.cs
- DBConcurrencyException.cs
- _Win32.cs
- OleDbRowUpdatedEvent.cs
- XmlSchemaComplexContentExtension.cs
- PropertyManager.cs
- COM2Properties.cs
- WmlPageAdapter.cs
- MessageSmuggler.cs
- UnsafeMethods.cs
- DataGridItemEventArgs.cs
- XmlSerializerOperationFormatter.cs
- AbandonedMutexException.cs
- ConsoleTraceListener.cs
- OracleBoolean.cs
- SqlConnectionString.cs
- InteropBitmapSource.cs
- exports.cs
- ViewCellSlot.cs
- UrlPath.cs
- MetadataArtifactLoaderComposite.cs
- CompositeDesignerAccessibleObject.cs
- EventKeyword.cs
- DateTimeUtil.cs
- ContainerSelectorActiveEvent.cs
- Condition.cs
- COAUTHINFO.cs
- AnnotationHelper.cs
- ValueChangedEventManager.cs
- SqlCharStream.cs
- BoolLiteral.cs
- Condition.cs
- GeometryCombineModeValidation.cs
- Attributes.cs
- WebServiceReceive.cs
- Touch.cs
- GroupLabel.cs
- DataGridPageChangedEventArgs.cs
- HttpRuntimeSection.cs
- DataGridAddNewRow.cs
- HtmlTableCell.cs
- Point4D.cs
- NetworkInformationException.cs
- NoClickablePointException.cs
- ClientFormsAuthenticationMembershipProvider.cs