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
- TextElementEnumerator.cs
- SafeBitVector32.cs
- RuntimeDelegateArgument.cs
- BlurEffect.cs
- LogExtent.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- DispatcherSynchronizationContext.cs
- OpenTypeLayoutCache.cs
- BinaryMethodMessage.cs
- ETagAttribute.cs
- DataGridViewButtonColumn.cs
- cache.cs
- XPathArrayIterator.cs
- FlowDocumentFormatter.cs
- ChangeProcessor.cs
- UnionCodeGroup.cs
- NotSupportedException.cs
- QueryAccessibilityHelpEvent.cs
- CategoryGridEntry.cs
- FlowDocumentPage.cs
- HttpClientCertificate.cs
- ExpandCollapseProviderWrapper.cs
- RangeContentEnumerator.cs
- PatternMatcher.cs
- WindowsGraphicsCacheManager.cs
- CodeTypeReference.cs
- Track.cs
- WindowsFormsLinkLabel.cs
- TextSimpleMarkerProperties.cs
- FormViewDeleteEventArgs.cs
- Style.cs
- CompilerGeneratedAttribute.cs
- DbDataRecord.cs
- TypeInfo.cs
- safelink.cs
- DynamicPropertyHolder.cs
- XmlDataLoader.cs
- ObjectDataSource.cs
- MutexSecurity.cs
- XmlElementAttribute.cs
- FamilyTypefaceCollection.cs
- GeneralTransform3DGroup.cs
- DataContractSerializer.cs
- DownloadProgressEventArgs.cs
- TransactionChannel.cs
- MessageSecurityOverHttp.cs
- IdentityNotMappedException.cs
- HostingEnvironmentException.cs
- DataSourceGroupCollection.cs
- JoinGraph.cs
- DesignTimeParseData.cs
- InvalidOleVariantTypeException.cs
- ReflectEventDescriptor.cs
- EntityContainerEntitySetDefiningQuery.cs
- CreateUserWizardStep.cs
- X509KeyIdentifierClauseType.cs
- InstanceDescriptor.cs
- XmlNamespaceMapping.cs
- mil_sdk_version.cs
- Parameter.cs
- CorrelationToken.cs
- UriParserTemplates.cs
- HttpRawResponse.cs
- ToolStripCollectionEditor.cs
- sqlinternaltransaction.cs
- LinkLabel.cs
- ReceiveSecurityHeader.cs
- FrugalMap.cs
- DataTemplate.cs
- SqlConnectionPoolProviderInfo.cs
- DBConnectionString.cs
- ResourceCodeDomSerializer.cs
- wmiprovider.cs
- Content.cs
- ThicknessKeyFrameCollection.cs
- DataGridColumnStyleMappingNameEditor.cs
- COM2EnumConverter.cs
- DataGrid.cs
- InstallerTypeAttribute.cs
- MemberAccessException.cs
- RangeValidator.cs
- TypeGeneratedEventArgs.cs
- DrawingContextWalker.cs
- PenContexts.cs
- WebConfigurationHostFileChange.cs
- SchemaImporterExtensionElementCollection.cs
- RuntimeConfig.cs
- ValidatorUtils.cs
- OptimalTextSource.cs
- TranslateTransform3D.cs
- NeutralResourcesLanguageAttribute.cs
- DesignSurfaceEvent.cs
- BaseCodePageEncoding.cs
- RepeaterCommandEventArgs.cs
- DataListItemCollection.cs
- ValidationHelper.cs
- DPTypeDescriptorContext.cs
- ObjectDataSourceStatusEventArgs.cs
- ImportedNamespaceContextItem.cs
- DataViewSettingCollection.cs