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
- ConditionalAttribute.cs
- CustomTokenProvider.cs
- UntypedNullExpression.cs
- DecoderNLS.cs
- Soap.cs
- safex509handles.cs
- CompiledRegexRunner.cs
- TableRowCollection.cs
- WebColorConverter.cs
- Compiler.cs
- OdbcEnvironment.cs
- TriggerCollection.cs
- Highlights.cs
- InheritablePropertyChangeInfo.cs
- LockCookie.cs
- FileEnumerator.cs
- XmlObjectSerializerContext.cs
- COAUTHIDENTITY.cs
- XamlPathDataSerializer.cs
- TableRowsCollectionEditor.cs
- TransferMode.cs
- Quad.cs
- JsonQNameDataContract.cs
- TrackingStringDictionary.cs
- followingsibling.cs
- OperationContext.cs
- NativeObjectSecurity.cs
- HttpFileCollection.cs
- SecurityKeyIdentifierClause.cs
- HtmlForm.cs
- UnSafeCharBuffer.cs
- WebResourceUtil.cs
- OleDbConnectionFactory.cs
- XmlSchemaComplexType.cs
- MimeWriter.cs
- PreviewPrintController.cs
- DescendentsWalkerBase.cs
- SecUtil.cs
- TabPage.cs
- IsolatedStorageFileStream.cs
- Region.cs
- ConnectionManagementElement.cs
- SqlProvider.cs
- ClientBuildManager.cs
- EditorZoneBase.cs
- HtmlTableCell.cs
- SafePEFileHandle.cs
- ResourceProviderFactory.cs
- UnauthorizedAccessException.cs
- MediaTimeline.cs
- SendMailErrorEventArgs.cs
- AssemblyResourceLoader.cs
- ContextMenu.cs
- BaseProcessor.cs
- IdentifierCollection.cs
- SafeThreadHandle.cs
- BeginCreateSecurityTokenRequest.cs
- PartialList.cs
- DecoderReplacementFallback.cs
- MemberPath.cs
- DataBoundControlHelper.cs
- MissingMemberException.cs
- IItemContainerGenerator.cs
- StringKeyFrameCollection.cs
- CfgSemanticTag.cs
- MonthChangedEventArgs.cs
- ProtocolsConfiguration.cs
- XmlQueryCardinality.cs
- SqlBuffer.cs
- PolyQuadraticBezierSegment.cs
- CodeTypeDeclarationCollection.cs
- XmlBinaryReaderSession.cs
- JsonDeserializer.cs
- EventLogLink.cs
- StrokeRenderer.cs
- BufferedGraphicsManager.cs
- LinqExpressionNormalizer.cs
- StringWriter.cs
- FileDialog.cs
- HTTPNotFoundHandler.cs
- Menu.cs
- Debug.cs
- SqlFunctions.cs
- InputEventArgs.cs
- EventBindingService.cs
- Constraint.cs
- TextPointerBase.cs
- TrustManager.cs
- SqlCrossApplyToCrossJoin.cs
- Pair.cs
- RC2CryptoServiceProvider.cs
- VariantWrapper.cs
- SpeechUI.cs
- CodeAttributeArgumentCollection.cs
- SafeNativeMethods.cs
- FileInfo.cs
- ServicePoint.cs
- FormViewDesigner.cs
- UriSectionReader.cs
- parserscommon.cs