Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / Util / GroupLabel.cs / 1 / GroupLabel.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- // GroupLabel.cs // // 6/10/99: [....]: created // namespace System.Web.UI.Design.Util { using System.Runtime.Serialization.Formatters; using System.Diagnostics; using System; using System.Windows.Forms; using System.Drawing; ////// /// A label control that draws an etched line beyond its text string /// Do not use the AutoSize property with this control /// ///[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] internal sealed class GroupLabel : Label { /// /// /// Creates a new GroupLabel /// public GroupLabel() : base() { SetStyle(ControlStyles.UserPaint, true); } ////// /// Custom UI is painted here /// protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; Rectangle r = ClientRectangle; string text = Text; Brush foreBrush = new SolidBrush(ForeColor); g.DrawString(text, Font, foreBrush, 0, 0); foreBrush.Dispose(); int etchLeft = r.X; if (text.Length != 0) { Size sz = Size.Ceiling(g.MeasureString(text, Font)); etchLeft += 4 + sz.Width; } int etchTop = r.Height / 2; g.DrawLine(SystemPens.ControlDark, etchLeft, etchTop, r.Width, etchTop); etchTop++; g.DrawLine(SystemPens.ControlLightLight, etchLeft, etchTop, r.Width, etchTop); } } } // 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
- CodeDomSerializerException.cs
- ModelItemDictionary.cs
- ListViewItemCollectionEditor.cs
- DynamicObject.cs
- odbcmetadatacollectionnames.cs
- Constraint.cs
- SiteMapProvider.cs
- ExpressionParser.cs
- XmlPropertyBag.cs
- TypeHelper.cs
- ContextStaticAttribute.cs
- LineGeometry.cs
- SingleSelectRootGridEntry.cs
- SwitchAttribute.cs
- dsa.cs
- XamlSerializer.cs
- ForeignConstraint.cs
- FixedHighlight.cs
- ProcessModule.cs
- WebPartEditorOkVerb.cs
- SafeThreadHandle.cs
- ComplexType.cs
- WindowsRebar.cs
- DocComment.cs
- UIElement.cs
- DataControlLinkButton.cs
- AsyncOperationManager.cs
- TemplateBaseAction.cs
- Crypto.cs
- CommandField.cs
- login.cs
- InkCanvasAutomationPeer.cs
- AssemblySettingAttributes.cs
- OleDbCommandBuilder.cs
- ApplicationSecurityManager.cs
- FileRecordSequenceHelper.cs
- OleDbEnumerator.cs
- AccessDataSourceView.cs
- IncrementalCompileAnalyzer.cs
- FontWeightConverter.cs
- RemoteX509AsymmetricSecurityKey.cs
- AutoResizedEvent.cs
- TypeInformation.cs
- DebugView.cs
- externdll.cs
- PathFigure.cs
- SerialStream.cs
- CharacterMetrics.cs
- StringSorter.cs
- ObjectStateEntry.cs
- QilVisitor.cs
- AtomContentProperty.cs
- DataGridViewSelectedCellCollection.cs
- DataGrid.cs
- WmlLinkAdapter.cs
- translator.cs
- ParallelTimeline.cs
- EventMappingSettings.cs
- SafeNativeMethodsMilCoreApi.cs
- GeneratedContractType.cs
- RpcAsyncResult.cs
- XpsResourceDictionary.cs
- Renderer.cs
- shaper.cs
- XPathEmptyIterator.cs
- DataRecordObjectView.cs
- DesignerGenericWebPart.cs
- BrowserCapabilitiesFactory.cs
- ConfigurationPropertyCollection.cs
- AnimationClockResource.cs
- ItemTypeToolStripMenuItem.cs
- SqlRetyper.cs
- BamlTreeNode.cs
- DataObjectEventArgs.cs
- IDReferencePropertyAttribute.cs
- CriticalFinalizerObject.cs
- DependencyObjectCodeDomSerializer.cs
- Decorator.cs
- CompositionCommandSet.cs
- CustomAttributeBuilder.cs
- Timer.cs
- DataRow.cs
- ListenerUnsafeNativeMethods.cs
- _ListenerRequestStream.cs
- ToolStripDropDownMenu.cs
- DataFormats.cs
- CodeTypeDeclarationCollection.cs
- ConfigXmlCDataSection.cs
- GenericsInstances.cs
- StickyNote.cs
- Context.cs
- IERequestCache.cs
- OdbcDataAdapter.cs
- InvalidComObjectException.cs
- WriteTimeStream.cs
- Command.cs
- ValueTypeFixupInfo.cs
- FontStyleConverter.cs
- IdentifierService.cs
- SecUtil.cs