Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / NoResizeHandleGlyph.cs / 1 / NoResizeHandleGlyph.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; using System.Runtime.InteropServices; ////// /// The NoResizeHandleGlyph represents the handle for a non-resizeable control in our new seleciton /// model. Note that the pen and brush are created once per instance of this class /// and re-used in our painting logic for perf. reasonse. /// internal class NoResizeHandleGlyph : SelectionGlyphBase { private bool isPrimary = false; ////// /// NoResizeHandleGlyph's constructor takes additional parameters: 'type' and 'primary selection'. /// Also, we create/cache our pen & brush here to avoid this action with every paint message. /// internal NoResizeHandleGlyph(Rectangle controlBounds, SelectionRules selRules, bool primarySelection, Behavior behavior) : base(behavior) { isPrimary = primarySelection; hitTestCursor = Cursors.Default; rules = SelectionRules.None; if ((selRules & SelectionRules.Moveable) != 0) { rules = SelectionRules.Moveable; hitTestCursor = Cursors.SizeAll; } // The handle is always upperleft bounds = new Rectangle(controlBounds.X - DesignerUtils.NORESIZEHANDLESIZE, controlBounds.Y - DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE); hitBounds = bounds; } ////// /// Very simple paint logic. /// public override void Paint(PaintEventArgs pe) { DesignerUtils.DrawNoResizeHandle(pe.Graphics, bounds, isPrimary, this); } } } // 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
- DoubleAnimationUsingPath.cs
- BrushMappingModeValidation.cs
- CacheOutputQuery.cs
- TargetInvocationException.cs
- PriorityQueue.cs
- BooleanAnimationBase.cs
- ThicknessAnimationUsingKeyFrames.cs
- OleAutBinder.cs
- ManagementObject.cs
- ListBindableAttribute.cs
- CallbackDebugElement.cs
- Rotation3DKeyFrameCollection.cs
- mediaclock.cs
- PropertyNames.cs
- TableLayoutPanel.cs
- SessionEndedEventArgs.cs
- ExtensionSimplifierMarkupObject.cs
- ListViewSortEventArgs.cs
- TemplateBaseAction.cs
- ObjectStateEntryDbDataRecord.cs
- FullTextBreakpoint.cs
- CustomCategoryAttribute.cs
- NativeMethods.cs
- XmlSchemaSimpleTypeRestriction.cs
- FrameworkElement.cs
- TabletCollection.cs
- ThemeableAttribute.cs
- DataGridItemEventArgs.cs
- CodeSnippetCompileUnit.cs
- SafeSecurityHandles.cs
- ToolboxItemLoader.cs
- XmlArrayItemAttribute.cs
- RelationshipEndMember.cs
- LinqDataView.cs
- HeaderUtility.cs
- TTSEvent.cs
- CalendarItem.cs
- TaskFileService.cs
- WindowsHyperlink.cs
- IntegerCollectionEditor.cs
- AutoSizeToolBoxItem.cs
- StringDictionaryEditor.cs
- OutputCacheSettingsSection.cs
- ParserExtension.cs
- PriorityRange.cs
- InternalRelationshipCollection.cs
- CompilationSection.cs
- CompilerGlobalScopeAttribute.cs
- ConnectionProviderAttribute.cs
- DocumentViewerBaseAutomationPeer.cs
- StructuredTypeEmitter.cs
- NativeObjectSecurity.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- DataGridAutomationPeer.cs
- DynamicValidatorEventArgs.cs
- Tablet.cs
- SqlFormatter.cs
- PropertyDescriptorCollection.cs
- NetStream.cs
- Int64Converter.cs
- ListControl.cs
- WebPartEventArgs.cs
- AgileSafeNativeMemoryHandle.cs
- DataGridBoundColumn.cs
- XmlSerializerSection.cs
- PerformanceCounterNameAttribute.cs
- ServerValidateEventArgs.cs
- GenericTextProperties.cs
- FileVersion.cs
- HashHelper.cs
- TaiwanCalendar.cs
- BooleanToVisibilityConverter.cs
- ComplexLine.cs
- InputMethod.cs
- TextRenderer.cs
- DataChangedEventManager.cs
- WorkflowCommandExtensionItem.cs
- updatecommandorderer.cs
- ScriptManagerProxy.cs
- SpanIndex.cs
- HitTestResult.cs
- MemberRelationshipService.cs
- SourceSwitch.cs
- ReflectTypeDescriptionProvider.cs
- ManifestBasedResourceGroveler.cs
- NonParentingControl.cs
- XmlBufferReader.cs
- WindowsAuthenticationModule.cs
- ControlCachePolicy.cs
- LineGeometry.cs
- SystemIcmpV6Statistics.cs
- XmlDataSourceDesigner.cs
- MethodBuilderInstantiation.cs
- BridgeDataReader.cs
- ConsoleTraceListener.cs
- EtwTrace.cs
- RootProfilePropertySettingsCollection.cs
- SqlTriggerAttribute.cs
- XmlNavigatorFilter.cs
- MDIClient.cs