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
- SoapAttributeOverrides.cs
- CopyOfAction.cs
- Addressing.cs
- ProfileGroupSettings.cs
- UInt16Converter.cs
- SqlDataSourceAdvancedOptionsForm.cs
- DataGridViewRowStateChangedEventArgs.cs
- DateTimeOffsetStorage.cs
- StringBlob.cs
- DataSourceComponent.cs
- FrameworkElementAutomationPeer.cs
- TextEffect.cs
- ZipIOExtraFieldPaddingElement.cs
- __TransparentProxy.cs
- MenuEventArgs.cs
- DataTableReaderListener.cs
- TcpHostedTransportConfiguration.cs
- PlainXmlSerializer.cs
- BitmapData.cs
- EntityDataSourceDataSelectionPanel.cs
- RootBrowserWindowAutomationPeer.cs
- HashStream.cs
- SqlProviderServices.cs
- SafeArrayRankMismatchException.cs
- OLEDB_Util.cs
- ActivityDesignerHighlighter.cs
- HiddenField.cs
- XmlDocumentFragment.cs
- GradientBrush.cs
- DBSqlParserTableCollection.cs
- CaseInsensitiveComparer.cs
- SafeFileHandle.cs
- FixedDocumentPaginator.cs
- GlyphInfoList.cs
- XmlSigningNodeWriter.cs
- Transform.cs
- ComNativeDescriptor.cs
- Utils.cs
- SafeCoTaskMem.cs
- ApplicationActivator.cs
- MultipartContentParser.cs
- MatchingStyle.cs
- SqlConnectionStringBuilder.cs
- ChooseAction.cs
- RelativeSource.cs
- odbcmetadatafactory.cs
- OrderedHashRepartitionStream.cs
- XsltException.cs
- FixedPosition.cs
- SqlCommandSet.cs
- StructuralType.cs
- XPathDescendantIterator.cs
- XamlReaderHelper.cs
- ProfileEventArgs.cs
- PermissionListSet.cs
- TextViewSelectionProcessor.cs
- AutomationPatternInfo.cs
- DoubleConverter.cs
- TextServicesManager.cs
- Registry.cs
- LinkedList.cs
- _ProxyRegBlob.cs
- WebProxyScriptElement.cs
- NavigationHelper.cs
- SingleAnimationBase.cs
- DrawListViewSubItemEventArgs.cs
- MetadataItem_Static.cs
- RadioButtonAutomationPeer.cs
- UseManagedPresentationBindingElement.cs
- XmlBoundElement.cs
- PerformanceCounter.cs
- KeyTime.cs
- ConstraintConverter.cs
- XmlProcessingInstruction.cs
- PerfService.cs
- XamlSerializerUtil.cs
- IImplicitResourceProvider.cs
- InputLanguageManager.cs
- IsolatedStorageFileStream.cs
- DateTimeConstantAttribute.cs
- DrawTreeNodeEventArgs.cs
- SHA256Managed.cs
- SQlBooleanStorage.cs
- SafeTimerHandle.cs
- CodeDirectoryCompiler.cs
- SchemaNamespaceManager.cs
- FrameworkElementFactoryMarkupObject.cs
- BamlReader.cs
- MetaModel.cs
- XmlChildEnumerator.cs
- ServicesUtilities.cs
- ContentPropertyAttribute.cs
- ClonableStack.cs
- MonitorWrapper.cs
- SchemaElementDecl.cs
- NullRuntimeConfig.cs
- EllipseGeometry.cs
- TaiwanCalendar.cs
- KeyedQueue.cs
- HttpProtocolReflector.cs