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
- TableItemPattern.cs
- ProcessActivityTreeOptions.cs
- X509Certificate.cs
- WorkflowPersistenceService.cs
- CheckBoxBaseAdapter.cs
- TextPointer.cs
- ToolboxDataAttribute.cs
- LineProperties.cs
- XPathAncestorIterator.cs
- RestHandler.cs
- NetworkInformationException.cs
- ListSortDescription.cs
- DeclarationUpdate.cs
- CategoryAttribute.cs
- GridSplitterAutomationPeer.cs
- DataSetUtil.cs
- FunctionDetailsReader.cs
- _ConnectStream.cs
- PathNode.cs
- TreeNodeConverter.cs
- UserValidatedEventArgs.cs
- DbConnectionOptions.cs
- HostingEnvironmentException.cs
- AnnotationComponentChooser.cs
- DataGridViewElement.cs
- HTTPNotFoundHandler.cs
- Monitor.cs
- AsnEncodedData.cs
- SettingsAttributes.cs
- EntitySetRetriever.cs
- TokenBasedSet.cs
- TextElementCollection.cs
- ExtendedPropertyCollection.cs
- CellParaClient.cs
- XmlSchemaAnnotated.cs
- ErrorRuntimeConfig.cs
- CodeCommentStatement.cs
- XPathAxisIterator.cs
- CacheAxisQuery.cs
- ZoneMembershipCondition.cs
- WmlValidationSummaryAdapter.cs
- DictionaryEditChange.cs
- OdbcDataAdapter.cs
- Reference.cs
- DbParameterCollectionHelper.cs
- OutputScope.cs
- ViewGenResults.cs
- DataGridAddNewRow.cs
- TextEndOfParagraph.cs
- userdatakeys.cs
- wgx_render.cs
- Pts.cs
- Binding.cs
- XmlSchemaGroupRef.cs
- BitmapEffectGeneralTransform.cs
- ConversionContext.cs
- XAMLParseException.cs
- SystemPens.cs
- StretchValidation.cs
- WebConfigurationManager.cs
- BlockCollection.cs
- MonitoringDescriptionAttribute.cs
- TypedReference.cs
- EntityDataSourceStatementEditorForm.cs
- KeyPressEvent.cs
- EventInfo.cs
- TextParagraphProperties.cs
- ListView.cs
- PingOptions.cs
- Convert.cs
- ProfileInfo.cs
- KnownBoxes.cs
- ConsoleTraceListener.cs
- _AuthenticationState.cs
- ChannelDispatcherBase.cs
- _SslSessionsCache.cs
- JulianCalendar.cs
- TripleDESCryptoServiceProvider.cs
- safelink.cs
- XMLSyntaxException.cs
- Empty.cs
- TrackBarRenderer.cs
- MediaPlayerState.cs
- StrongNameMembershipCondition.cs
- xamlnodes.cs
- ProxyAttribute.cs
- BrowsableAttribute.cs
- TokenBasedSetEnumerator.cs
- SmiEventSink_DeferedProcessing.cs
- DrawingVisualDrawingContext.cs
- PointLightBase.cs
- DefaultPrintController.cs
- Bits.cs
- FontEditor.cs
- Buffer.cs
- DoubleAnimationBase.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- DependencyObject.cs
- ApplicationSecurityInfo.cs
- BufferedOutputStream.cs