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
- DataKeyPropertyAttribute.cs
- IPEndPoint.cs
- ControlPaint.cs
- ExceptionUtil.cs
- ReadWriteSpinLock.cs
- SQLResource.cs
- ObjRef.cs
- PropertySegmentSerializer.cs
- XmlRootAttribute.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- BitmapFrame.cs
- TextViewSelectionProcessor.cs
- FaultConverter.cs
- TextBounds.cs
- RadioButton.cs
- PerformanceCountersElement.cs
- ConfigurationManagerHelper.cs
- RelationshipEnd.cs
- EdmItemError.cs
- HttpCachePolicyElement.cs
- _HeaderInfo.cs
- EventListener.cs
- WebBrowserHelper.cs
- TimelineCollection.cs
- OneWayBindingElement.cs
- InvalidFilterCriteriaException.cs
- Duration.cs
- AssociatedControlConverter.cs
- translator.cs
- ActivationServices.cs
- MaskDescriptor.cs
- DataColumnMapping.cs
- GatewayDefinition.cs
- DialogResultConverter.cs
- ActivityCodeGenerator.cs
- _ContextAwareResult.cs
- CriticalFileToken.cs
- EntityDataSourceState.cs
- CodeVariableReferenceExpression.cs
- ReadOnlyCollectionBase.cs
- LinkClickEvent.cs
- Activator.cs
- Overlapped.cs
- XmlWrappingWriter.cs
- Timeline.cs
- SqlClientWrapperSmiStreamChars.cs
- SortQuery.cs
- UnsafeNativeMethods.cs
- BookmarkOptionsHelper.cs
- RewritingProcessor.cs
- CalendarAutoFormatDialog.cs
- CornerRadiusConverter.cs
- TypedElement.cs
- VisualBrush.cs
- Timer.cs
- ConsoleTraceListener.cs
- ControlBuilder.cs
- GuidConverter.cs
- WsdlBuildProvider.cs
- BCryptNative.cs
- BuiltInPermissionSets.cs
- DefaultPropertyAttribute.cs
- ImageListUtils.cs
- MenuBase.cs
- ToolStripDropDownDesigner.cs
- AdapterUtil.cs
- Storyboard.cs
- JsonSerializer.cs
- WebBrowserBase.cs
- ScriptDescriptor.cs
- ClientUtils.cs
- LambdaCompiler.Lambda.cs
- PropertyItem.cs
- ZipIOModeEnforcingStream.cs
- returneventsaver.cs
- DrawingContextDrawingContextWalker.cs
- Operator.cs
- PropertyExpression.cs
- SupportsEventValidationAttribute.cs
- SeekStoryboard.cs
- TdsParameterSetter.cs
- SrgsItemList.cs
- Source.cs
- UTF7Encoding.cs
- ScriptReferenceBase.cs
- ViewStateException.cs
- Matrix.cs
- AssociationSet.cs
- RequiredAttributeAttribute.cs
- AggregatePushdown.cs
- CounterCreationDataCollection.cs
- figurelengthconverter.cs
- CodeDOMProvider.cs
- TagPrefixAttribute.cs
- InvalidComObjectException.cs
- StrokeNode.cs
- KeyEvent.cs
- WebReferencesBuildProvider.cs
- WCFServiceClientProxyGenerator.cs
- TraceEventCache.cs