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
- DecimalFormatter.cs
- ContractNamespaceAttribute.cs
- Enlistment.cs
- Stopwatch.cs
- HtmlShim.cs
- ListItemConverter.cs
- InvokePatternIdentifiers.cs
- StylusPointPropertyId.cs
- Process.cs
- AuthenticatingEventArgs.cs
- GACMembershipCondition.cs
- BlurEffect.cs
- HostedHttpTransportManager.cs
- ScrollPatternIdentifiers.cs
- WaitHandleCannotBeOpenedException.cs
- PageAsyncTaskManager.cs
- ProtocolElement.cs
- EdgeProfileValidation.cs
- HwndHost.cs
- TraceLevelStore.cs
- EntityContainerEmitter.cs
- ListViewSortEventArgs.cs
- EditorZoneDesigner.cs
- CompareInfo.cs
- BindToObject.cs
- MimeTypePropertyAttribute.cs
- baseshape.cs
- VisualBasicSettingsConverter.cs
- ViewManager.cs
- ListViewDeleteEventArgs.cs
- NavigationProperty.cs
- VerificationException.cs
- TableDetailsCollection.cs
- IdnElement.cs
- MessageSmuggler.cs
- FileLevelControlBuilderAttribute.cs
- SQlBooleanStorage.cs
- SourceItem.cs
- DataStreamFromComStream.cs
- SystemWebSectionGroup.cs
- ObjectConverter.cs
- ButtonChrome.cs
- QueueTransferProtocol.cs
- ListControlConvertEventArgs.cs
- DetailsViewRow.cs
- DataGrid.cs
- Attributes.cs
- KnownBoxes.cs
- DataControlImageButton.cs
- MediaTimeline.cs
- ScrollItemPatternIdentifiers.cs
- DataViewManagerListItemTypeDescriptor.cs
- EditorBrowsableAttribute.cs
- PointAnimationUsingPath.cs
- CodeTryCatchFinallyStatement.cs
- DataGridViewCellValidatingEventArgs.cs
- WebPartZoneCollection.cs
- HttpCookie.cs
- AxisAngleRotation3D.cs
- DataTableReaderListener.cs
- PointCollection.cs
- ElasticEase.cs
- WebConfigurationFileMap.cs
- Int32Storage.cs
- BufferedOutputStream.cs
- RunClient.cs
- FormatVersion.cs
- ToolStripDropDownButton.cs
- CheckedPointers.cs
- ConfigurationManagerHelperFactory.cs
- WaitHandle.cs
- MissingMethodException.cs
- EncryptedKey.cs
- XhtmlBasicLinkAdapter.cs
- EdmType.cs
- Inflater.cs
- VisualBrush.cs
- SmtpSection.cs
- DrawingGroupDrawingContext.cs
- HttpCookieCollection.cs
- EntityDataReader.cs
- XmlSerializerNamespaces.cs
- DataGridRowEventArgs.cs
- EventProviderWriter.cs
- BookmarkWorkItem.cs
- RuleAction.cs
- ViewGenResults.cs
- DesignerLabelAdapter.cs
- PenThreadWorker.cs
- SemaphoreFullException.cs
- MarshalDirectiveException.cs
- HandleCollector.cs
- EntityCommandDefinition.cs
- VirtualizedItemProviderWrapper.cs
- OrthographicCamera.cs
- SingleStorage.cs
- ScriptReferenceBase.cs
- DetailsViewDeletedEventArgs.cs
- _DomainName.cs
- ConnectionStringsExpressionBuilder.cs