Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / InheritanceUI.cs / 1 / InheritanceUI.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms.Design { using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Design; using System.Drawing; using System.Diagnostics; using System.Windows.Forms; ////// This class handles the user interface for inherited components. /// internal class InheritanceUI { private static Bitmap inheritanceGlyph; private static Rectangle inheritanceGlyphRect; private ToolTip tooltip; ////// The bitmap we use to show inheritance. /// public Bitmap InheritanceGlyph { get { if (inheritanceGlyph == null) { inheritanceGlyph = new Bitmap(typeof(InheritanceUI), "InheritedGlyph.bmp"); inheritanceGlyph.MakeTransparent(); } return inheritanceGlyph; } } ////// The rectangle surrounding the glyph. /// public Rectangle InheritanceGlyphRectangle { get { if (inheritanceGlyphRect == Rectangle.Empty) { Size size = InheritanceGlyph.Size; inheritanceGlyphRect = new Rectangle(0, 0, size.Width, size.Height); } return inheritanceGlyphRect; } } ////// Adds an inherited control to our list. This creates a tool tip for that /// control. /// public void AddInheritedControl(Control c, InheritanceLevel level) { if (tooltip == null) { tooltip = new ToolTip(); tooltip.ShowAlways = true; } Debug.Assert(level != InheritanceLevel.NotInherited, "This should only be called for inherited components."); string text; if (level == InheritanceLevel.InheritedReadOnly) { text = SR.GetString(SR.DesignerInheritedReadOnly); } else { text = SR.GetString(SR.DesignerInherited); } tooltip.SetToolTip(c, text); // Also, set all of its non-sited children foreach(Control child in c.Controls) { if (child.Site == null) { tooltip.SetToolTip(child, text); } } } public void Dispose() { if (tooltip != null) { tooltip.Dispose(); } } ////// Removes a previously added inherited control. /// public void RemoveInheritedControl(Control c) { if (tooltip != null && tooltip.GetToolTip(c).Length > 0) { tooltip.SetToolTip(c, null); // Also, set all of its non-sited children foreach(Control child in c.Controls) { if (child.Site == null) { tooltip.SetToolTip(child, null); } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Vertex.cs
- PackUriHelper.cs
- DayRenderEvent.cs
- Html32TextWriter.cs
- SiteMembershipCondition.cs
- JapaneseLunisolarCalendar.cs
- ListBindableAttribute.cs
- InputLanguageEventArgs.cs
- OleDbConnectionInternal.cs
- Variable.cs
- TreeViewImageIndexConverter.cs
- RectangleGeometry.cs
- TextMetrics.cs
- ValidatorCompatibilityHelper.cs
- Main.cs
- AutoFocusStyle.xaml.cs
- TextBox.cs
- FeatureSupport.cs
- GradientBrush.cs
- OracleConnectionFactory.cs
- loginstatus.cs
- SqlTrackingQuery.cs
- Win32.cs
- PasswordRecovery.cs
- TemplateField.cs
- IIS7UserPrincipal.cs
- RuleSettings.cs
- DesignerSerializerAttribute.cs
- Attributes.cs
- MessageQueuePermissionEntry.cs
- WriteableBitmap.cs
- BamlStream.cs
- ControlBuilder.cs
- AsyncResult.cs
- SamlDelegatingWriter.cs
- HttpProfileGroupBase.cs
- SecurityUtils.cs
- InProcStateClientManager.cs
- EntityProxyFactory.cs
- ASCIIEncoding.cs
- WebMessageEncoderFactory.cs
- SiteMapProvider.cs
- Operators.cs
- FusionWrap.cs
- CompiledRegexRunner.cs
- ToolBarTray.cs
- HtmlLink.cs
- Int64AnimationUsingKeyFrames.cs
- MimePart.cs
- ColorEditor.cs
- PairComparer.cs
- MouseGesture.cs
- AuthorizationRuleCollection.cs
- XmlAttributeOverrides.cs
- ColumnPropertiesGroup.cs
- InstanceKeyCollisionException.cs
- GlyphInfoList.cs
- CachedTypeface.cs
- _UriTypeConverter.cs
- translator.cs
- SerializationInfoEnumerator.cs
- ConcurrentBag.cs
- ToolStripSplitButton.cs
- DbSourceCommand.cs
- BitmapEffectState.cs
- DbProviderSpecificTypePropertyAttribute.cs
- LicenseProviderAttribute.cs
- ServiceHostingEnvironment.cs
- Cursor.cs
- WebBrowserSiteBase.cs
- Application.cs
- XmlSignificantWhitespace.cs
- SemanticTag.cs
- DrawingGroupDrawingContext.cs
- PageClientProxyGenerator.cs
- ProfileEventArgs.cs
- HttpApplication.cs
- DocumentViewerBase.cs
- EmptyImpersonationContext.cs
- MemberPathMap.cs
- TableItemStyle.cs
- AvTraceDetails.cs
- XmlAnyAttributeAttribute.cs
- DnsPermission.cs
- ProtocolInformationReader.cs
- DoWorkEventArgs.cs
- DCSafeHandle.cs
- TextEffect.cs
- ImageAttributes.cs
- PathParser.cs
- XamlGridLengthSerializer.cs
- OdbcConnectionFactory.cs
- MessageTransmitTraceRecord.cs
- CounterSample.cs
- HandlerFactoryCache.cs
- TabletDeviceInfo.cs
- SqlComparer.cs
- InkPresenter.cs
- PropertyChangeTracker.cs
- ImportCatalogPart.cs