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
- WebBrowser.cs
- FixedPageAutomationPeer.cs
- EpmTargetTree.cs
- SettingsPropertyIsReadOnlyException.cs
- BindingSource.cs
- ToolbarAUtomationPeer.cs
- MessageUtil.cs
- ImportCatalogPart.cs
- VoiceChangeEventArgs.cs
- XmlMemberMapping.cs
- BinaryFormatter.cs
- MobileControlsSection.cs
- ImageSourceConverter.cs
- EntitySqlQueryCacheEntry.cs
- Delegate.cs
- ValueTable.cs
- LinkUtilities.cs
- StickyNote.cs
- DataViewManager.cs
- CodePageEncoding.cs
- UserControl.cs
- XsltSettings.cs
- SQLSingleStorage.cs
- PointCollection.cs
- StateMachineSubscription.cs
- XmlDocumentFieldSchema.cs
- InputProviderSite.cs
- MsmqInputChannelListener.cs
- DataBindingHandlerAttribute.cs
- TextDpi.cs
- EntityConnection.cs
- XamlWriter.cs
- KeySplineConverter.cs
- Int64AnimationUsingKeyFrames.cs
- _LocalDataStore.cs
- DataGridViewImageCell.cs
- SqlUtils.cs
- XPathChildIterator.cs
- ProcessRequestArgs.cs
- IxmlLineInfo.cs
- SettingsAttributes.cs
- LambdaCompiler.Statements.cs
- CfgArc.cs
- PolicyManager.cs
- WebBrowser.cs
- DataError.cs
- Collection.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- RelatedCurrencyManager.cs
- MULTI_QI.cs
- HttpStreamMessageEncoderFactory.cs
- WebUtil.cs
- ServiceObjectContainer.cs
- ResXDataNode.cs
- TemplateBuilder.cs
- HttpListenerPrefixCollection.cs
- TableCellsCollectionEditor.cs
- FrameworkTemplate.cs
- Privilege.cs
- TypeListConverter.cs
- GridViewSelectEventArgs.cs
- SspiSafeHandles.cs
- QueryParameter.cs
- LoadWorkflowByKeyAsyncResult.cs
- ResourceDescriptionAttribute.cs
- ClientRolePrincipal.cs
- Predicate.cs
- SiteMapPath.cs
- SimpleMailWebEventProvider.cs
- Transform3D.cs
- ProfileEventArgs.cs
- _NativeSSPI.cs
- TextElementEnumerator.cs
- ProfileManager.cs
- ResponseStream.cs
- HitTestWithGeometryDrawingContextWalker.cs
- StrokeCollectionDefaultValueFactory.cs
- ScriptRegistrationManager.cs
- SqlBulkCopy.cs
- CellPartitioner.cs
- ListMarkerLine.cs
- ObfuscateAssemblyAttribute.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- DetailsViewDeleteEventArgs.cs
- PropertyKey.cs
- SourceSwitch.cs
- DeflateStream.cs
- GrammarBuilderBase.cs
- TransformerTypeCollection.cs
- ToolStripItemTextRenderEventArgs.cs
- XXXInfos.cs
- HttpPostProtocolReflector.cs
- SchemeSettingElementCollection.cs
- __ConsoleStream.cs
- DataGridViewCellStyleChangedEventArgs.cs
- TCPClient.cs
- AttributeProviderAttribute.cs
- DataGridPagingPage.cs
- Adorner.cs
- ColumnCollection.cs