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
- DocumentGrid.cs
- TemplateModeChangedEventArgs.cs
- FixedStringLookup.cs
- MessageQueueAccessControlEntry.cs
- SelectedDatesCollection.cs
- MemberDomainMap.cs
- DateTimeConstantAttribute.cs
- PtsHelper.cs
- CodeDelegateCreateExpression.cs
- PropertyTabAttribute.cs
- _TransmitFileOverlappedAsyncResult.cs
- TextElementAutomationPeer.cs
- WindowsGraphicsWrapper.cs
- ServiceModelExtensionElement.cs
- HelpProvider.cs
- TemplatePagerField.cs
- PropertyGroupDescription.cs
- DispatcherHooks.cs
- HandlerFactoryCache.cs
- CallTemplateAction.cs
- PerformanceCountersElement.cs
- SizeAnimationBase.cs
- DefaultParameterValueAttribute.cs
- FieldDescriptor.cs
- CorePropertiesFilter.cs
- CompatibleIComparer.cs
- JsonFormatGeneratorStatics.cs
- OuterGlowBitmapEffect.cs
- HandledEventArgs.cs
- RegexCaptureCollection.cs
- PlanCompiler.cs
- ProcessModule.cs
- UInt32Storage.cs
- SQLInt64.cs
- PropertySegmentSerializer.cs
- FileAuthorizationModule.cs
- TypeSemantics.cs
- OperatingSystem.cs
- ProviderIncompatibleException.cs
- ArgumentValueSerializer.cs
- SequenceDesigner.xaml.cs
- MDIWindowDialog.cs
- CodeConditionStatement.cs
- FixedStringLookup.cs
- OdbcPermission.cs
- FontCacheUtil.cs
- TransformPattern.cs
- Int32CollectionConverter.cs
- PersonalizableTypeEntry.cs
- EmptyElement.cs
- GuidTagList.cs
- Queue.cs
- BaseCAMarshaler.cs
- ServerType.cs
- SizeF.cs
- RuleInfoComparer.cs
- FirstMatchCodeGroup.cs
- MailBnfHelper.cs
- Margins.cs
- DefaultValueTypeConverter.cs
- ContentPlaceHolder.cs
- DbConnectionInternal.cs
- TemplateGroupCollection.cs
- Keywords.cs
- Tuple.cs
- QuotedStringWriteStateInfo.cs
- OracleException.cs
- ChannelPool.cs
- ContainerSelectorActiveEvent.cs
- HyperLinkColumn.cs
- QilList.cs
- Int32RectValueSerializer.cs
- MsmqInputMessage.cs
- OperationCanceledException.cs
- RegistrySecurity.cs
- GridViewSortEventArgs.cs
- SqlCommandSet.cs
- PeerTransportElement.cs
- VoiceInfo.cs
- GenericsInstances.cs
- Timeline.cs
- WindowsRebar.cs
- StrongNamePublicKeyBlob.cs
- WeakReference.cs
- DataGridViewRowCollection.cs
- PathTooLongException.cs
- ApplicationInfo.cs
- ObjectDesignerDataSourceView.cs
- UnescapedXmlDiagnosticData.cs
- GuidConverter.cs
- BindingMAnagerBase.cs
- OdbcHandle.cs
- SimpleLine.cs
- TextContainer.cs
- TableCellCollection.cs
- CompositeKey.cs
- ArithmeticException.cs
- DoubleLink.cs
- XmlNullResolver.cs
- BamlResourceContent.cs