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
- IUnknownConstantAttribute.cs
- FamilyCollection.cs
- CallbackCorrelationInitializer.cs
- TemplatedMailWebEventProvider.cs
- ProcessManager.cs
- DataGridViewCellStateChangedEventArgs.cs
- AttributeEmitter.cs
- QueueProcessor.cs
- XmlObjectSerializerContext.cs
- SerializerProvider.cs
- ScriptModule.cs
- FlowDocumentFormatter.cs
- SqlRowUpdatedEvent.cs
- DataTablePropertyDescriptor.cs
- StringExpressionSet.cs
- Rect3DValueSerializer.cs
- Function.cs
- ObjectStateManagerMetadata.cs
- HttpCacheVaryByContentEncodings.cs
- ClosureBinding.cs
- DataGridViewComponentPropertyGridSite.cs
- Image.cs
- UICuesEvent.cs
- TemplateApplicationHelper.cs
- AssemblyAttributes.cs
- Int32.cs
- FixedSOMLineCollection.cs
- TemplateInstanceAttribute.cs
- ClientSideProviderDescription.cs
- DnsPermission.cs
- UnmanagedHandle.cs
- DrawTreeNodeEventArgs.cs
- RestHandlerFactory.cs
- InkSerializer.cs
- Style.cs
- PhysicalAddress.cs
- MatrixValueSerializer.cs
- ComponentResourceManager.cs
- ToolStripItem.cs
- SimpleBitVector32.cs
- ClassHandlersStore.cs
- MTConfigUtil.cs
- ThreadStaticAttribute.cs
- RuntimeConfigurationRecord.cs
- Style.cs
- FileSystemWatcher.cs
- _ScatterGatherBuffers.cs
- EventProvider.cs
- PagedDataSource.cs
- SQLInt32.cs
- CompositeDataBoundControl.cs
- DataTableCollection.cs
- MsmqIntegrationBindingElement.cs
- ReadOnlyPropertyMetadata.cs
- TraceInternal.cs
- StyleTypedPropertyAttribute.cs
- XmlWriterSettings.cs
- EntityDesignerDataSourceView.cs
- MissingFieldException.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ErrorFormatter.cs
- TextRangeSerialization.cs
- QuaternionAnimation.cs
- BCLDebug.cs
- LinkButton.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- QuotedStringWriteStateInfo.cs
- FrameworkContextData.cs
- LocalizeDesigner.cs
- GridViewUpdateEventArgs.cs
- XsltFunctions.cs
- DefaultClaimSet.cs
- LambdaExpression.cs
- IdleTimeoutMonitor.cs
- ThousandthOfEmRealPoints.cs
- SqlNodeTypeOperators.cs
- ScriptingProfileServiceSection.cs
- SQLDateTimeStorage.cs
- ColumnWidthChangingEvent.cs
- CookieHandler.cs
- NullableFloatMinMaxAggregationOperator.cs
- DesignerActionListCollection.cs
- TreeNodeCollection.cs
- NavigationWindow.cs
- Canvas.cs
- sqlser.cs
- ConfigXmlText.cs
- ObjectReferenceStack.cs
- WorkflowApplicationAbortedEventArgs.cs
- ContractListAdapter.cs
- HttpCapabilitiesSectionHandler.cs
- Soap.cs
- DeliveryStrategy.cs
- StrokeSerializer.cs
- DynamicPropertyReader.cs
- FixedSOMImage.cs
- TextChange.cs
- IsolatedStoragePermission.cs
- LineInfo.cs
- TimerTable.cs