Code:
/ FX-1434 / FX-1434 / 1.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
- WebBrowserPermission.cs
- TextParagraphCache.cs
- X509UI.cs
- MessageEncoder.cs
- Bidi.cs
- ObjectCloneHelper.cs
- XmlSigningNodeWriter.cs
- RemotingAttributes.cs
- ScriptRef.cs
- SourceFileBuildProvider.cs
- ErrorWebPart.cs
- TransactionContext.cs
- GestureRecognitionResult.cs
- mactripleDES.cs
- MatchingStyle.cs
- _HeaderInfoTable.cs
- DataGridViewSelectedRowCollection.cs
- SetMemberBinder.cs
- ConnectivityStatus.cs
- CodeGotoStatement.cs
- _ProxyChain.cs
- XmlSchemaValidator.cs
- ToolStripItemRenderEventArgs.cs
- ContentElementAutomationPeer.cs
- ProfileModule.cs
- PathFigure.cs
- AsynchronousChannelMergeEnumerator.cs
- StylusPointPropertyUnit.cs
- LogSwitch.cs
- ProjectionQueryOptionExpression.cs
- PageContentCollection.cs
- HttpStreams.cs
- QilCloneVisitor.cs
- CopyEncoder.cs
- NameObjectCollectionBase.cs
- CodeActivity.cs
- ColumnMapTranslator.cs
- EventRouteFactory.cs
- WebControlParameterProxy.cs
- SoapEnumAttribute.cs
- DiagnosticsConfiguration.cs
- NamespaceQuery.cs
- SafeNativeMethods.cs
- RequestValidator.cs
- DesignerOptionService.cs
- CancellationTokenRegistration.cs
- QilXmlReader.cs
- RegistryExceptionHelper.cs
- HtmlInputPassword.cs
- ProcessRequestArgs.cs
- LoopExpression.cs
- ServicePointManager.cs
- ApplicationHost.cs
- BasicBrowserDialog.designer.cs
- CodeIndexerExpression.cs
- TimeManager.cs
- DayRenderEvent.cs
- TabControlAutomationPeer.cs
- regiisutil.cs
- WebRequestModuleElementCollection.cs
- CodeAttributeDeclarationCollection.cs
- SurrogateEncoder.cs
- Asn1Utilities.cs
- LocalizationParserHooks.cs
- XamlPoint3DCollectionSerializer.cs
- DocumentSignatureManager.cs
- TrackingLocation.cs
- DurationConverter.cs
- XhtmlConformanceSection.cs
- HoistedLocals.cs
- ProfileSection.cs
- FullTextState.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- TypefaceMap.cs
- AppModelKnownContentFactory.cs
- PageBuildProvider.cs
- MasterPageParser.cs
- COM2PropertyBuilderUITypeEditor.cs
- WmfPlaceableFileHeader.cs
- Page.cs
- TimeSpanOrInfiniteValidator.cs
- ByteStack.cs
- LinearKeyFrames.cs
- LicenseException.cs
- HttpUnhandledOperationInvoker.cs
- MouseBinding.cs
- ListViewHitTestInfo.cs
- EventArgs.cs
- TableLayoutStyleCollection.cs
- XmlObjectSerializerWriteContext.cs
- MenuRendererClassic.cs
- _IPv4Address.cs
- QueryCacheKey.cs
- UserControl.cs
- PingOptions.cs
- DataKey.cs
- __Filters.cs
- EpmSyndicationContentDeSerializer.cs
- SuppressMergeCheckAttribute.cs
- ExceptionUtil.cs