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
- SectionVisual.cs
- TokenizerHelper.cs
- SpeechAudioFormatInfo.cs
- Timer.cs
- MsmqChannelFactory.cs
- RoleService.cs
- ExpressionParser.cs
- ContentValidator.cs
- PrintPageEvent.cs
- MethodToken.cs
- PrinterResolution.cs
- HttpCookie.cs
- DataGridColumnHeadersPresenter.cs
- HtmlTable.cs
- TaskFileService.cs
- LoginUtil.cs
- DataContractSerializerSection.cs
- BitmapEffectDrawingContextWalker.cs
- WebDescriptionAttribute.cs
- ZoomPercentageConverter.cs
- ArrayHelper.cs
- XmlQualifiedNameTest.cs
- TagMapInfo.cs
- sqlcontext.cs
- Part.cs
- ItemCheckEvent.cs
- _ConnectOverlappedAsyncResult.cs
- Hyperlink.cs
- HttpProtocolReflector.cs
- StylusButtonEventArgs.cs
- DecimalAnimation.cs
- Root.cs
- BamlCollectionHolder.cs
- MatchingStyle.cs
- IndentedWriter.cs
- ReferentialConstraint.cs
- Converter.cs
- RightsManagementPermission.cs
- Pointer.cs
- SR.cs
- GridViewDeleteEventArgs.cs
- Geometry3D.cs
- RelationshipNavigation.cs
- XmlNodeList.cs
- XsdDateTime.cs
- SystemWebSectionGroup.cs
- HostDesigntimeLicenseContext.cs
- SchemaNamespaceManager.cs
- ReliableReplySessionChannel.cs
- DragDropHelper.cs
- ActivityInterfaces.cs
- FormattedText.cs
- Imaging.cs
- AttributeData.cs
- RuleSettings.cs
- DesignerActionListCollection.cs
- GridViewHeaderRowPresenter.cs
- ListItemParagraph.cs
- SafeThemeHandle.cs
- SqlBooleanMismatchVisitor.cs
- ListViewItemSelectionChangedEvent.cs
- AnchorEditor.cs
- ServiceChannel.cs
- DurationConverter.cs
- RelativeSource.cs
- SapiInterop.cs
- SafeReadContext.cs
- DebugView.cs
- SurrogateChar.cs
- KnownBoxes.cs
- WindowsSysHeader.cs
- PKCS1MaskGenerationMethod.cs
- EntityDataSourceReferenceGroup.cs
- SHA1.cs
- SoapIncludeAttribute.cs
- FacetDescriptionElement.cs
- HashCryptoHandle.cs
- DataMisalignedException.cs
- EnumConverter.cs
- XmlDictionaryWriter.cs
- Matrix.cs
- ProfilePropertySettingsCollection.cs
- BitmapFrameEncode.cs
- SortQueryOperator.cs
- DeferredSelectedIndexReference.cs
- ParameterReplacerVisitor.cs
- EventMappingSettings.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- IHttpResponseInternal.cs
- ServiceX509SecurityTokenProvider.cs
- XPathMultyIterator.cs
- Asn1IntegerConverter.cs
- ValidationManager.cs
- DbProviderManifest.cs
- SettingsContext.cs
- ViewManager.cs
- MarkupCompilePass2.cs
- Invariant.cs
- XPathNodeList.cs
- SafeSecurityHelper.cs