Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / TrustUi / MS / Internal / documents / DialogDivider.cs / 1 / DialogDivider.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description:
// DialogDivider: A simple divider used XPS viewer's WinForms dialogs.
//
// History:
// 02/09/2006 - [....] created
//
//---------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Security;
using System.Windows.Forms;
using System.IO.Packaging;
using System.Windows.TrustUI;
using MS.Internal.PresentationUI;
namespace MS.Internal.Documents
{
///
/// DialogDivider draws a simple divider used in XPS Viewer's WinForms dialogs.
/// It always assumes 1 pixel of height and the width of its parent (or 0 if null)
/// regardless of any user settings.
///
internal class DialogDivider : System.Windows.Forms.Control
{
#region Constructors
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
///
/// The constructor
///
internal DialogDivider()
{
TabStop = false;
}
#endregion Constructors
///
/// SetBoundsCore override. We enforce a 1 pixel
/// height and a width equal to the width of its parent.
///
///
///
///
///
///
protected override void SetBoundsCore(
int x,
int y,
int width,
int height,
BoundsSpecified specified )
{
if (Parent != null)
{
//Force a 1-pixel height, with the width of our immediate parent
base.SetBoundsCore(Parent.Location.X, y, Parent.Size.Width, 1, specified);
}
else
{
//No parent, just assume 0 by 0.
base.SetBoundsCore(x, y, 0, 0, specified);
}
}
///
/// OnPaint override. We draw a 1-pixel-high line from one end of our client
/// region to the other, thus drawing the divider.
///
///
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
//Draw a line from one side of our client bounds to the other.
e.Graphics.DrawLine(
new Pen(new SolidBrush(System.Drawing.SystemColors.ControlDark)),
ClientRectangle.Left,
0,
ClientRectangle.Right,
0);
}
}
}
// 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
- XmlDataSourceView.cs
- BitHelper.cs
- ListViewInsertedEventArgs.cs
- GridViewSortEventArgs.cs
- ClientUrlResolverWrapper.cs
- DataGridViewCellCancelEventArgs.cs
- OleDbConnectionFactory.cs
- DataRowExtensions.cs
- WebPartEditorApplyVerb.cs
- Lock.cs
- SubMenuStyleCollection.cs
- CursorConverter.cs
- HostingEnvironmentSection.cs
- TabItemAutomationPeer.cs
- FigureHelper.cs
- InternalTransaction.cs
- MergePropertyDescriptor.cs
- Wizard.cs
- HScrollProperties.cs
- SafeNativeMethods.cs
- ExecutionEngineException.cs
- StaticExtension.cs
- AsyncContentLoadedEventArgs.cs
- DefaultProxySection.cs
- TextAnchor.cs
- RequestDescription.cs
- FixedTextContainer.cs
- FixedDocument.cs
- EdmMember.cs
- SystemDiagnosticsSection.cs
- odbcmetadatacollectionnames.cs
- complextypematerializer.cs
- WorkflowOperationBehavior.cs
- TextParagraphView.cs
- AlignmentXValidation.cs
- EntityTemplateUserControl.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- MessageDirection.cs
- DataGridCheckBoxColumn.cs
- DataServiceHostFactory.cs
- UniqueTransportManagerRegistration.cs
- Msec.cs
- SqlDataSourceEnumerator.cs
- VBIdentifierDesigner.xaml.cs
- EasingQuaternionKeyFrame.cs
- TextParagraphCache.cs
- XmlSchemaSequence.cs
- ErrorFormatterPage.cs
- Sql8ConformanceChecker.cs
- RequestUriProcessor.cs
- PropertyEmitter.cs
- ToggleProviderWrapper.cs
- DrawingCollection.cs
- PermissionSet.cs
- OleAutBinder.cs
- AffineTransform3D.cs
- SymLanguageVendor.cs
- InputLanguageSource.cs
- SemanticAnalyzer.cs
- XmlSchemas.cs
- InvokeSchedule.cs
- GlyphInfoList.cs
- BindStream.cs
- DataBinder.cs
- ExpandCollapseProviderWrapper.cs
- _LazyAsyncResult.cs
- HttpCachePolicyWrapper.cs
- Roles.cs
- HtmlInputSubmit.cs
- ArgumentsParser.cs
- MoveSizeWinEventHandler.cs
- TraceListener.cs
- Calendar.cs
- MenuAutomationPeer.cs
- UserNameSecurityTokenParameters.cs
- BindingValueChangedEventArgs.cs
- ButtonBaseAdapter.cs
- ValueProviderWrapper.cs
- SystemFonts.cs
- ScriptControl.cs
- Debug.cs
- DataGridViewRowStateChangedEventArgs.cs
- CriticalHandle.cs
- LOSFormatter.cs
- ResizeGrip.cs
- MimeFormatter.cs
- ColumnMapProcessor.cs
- InitializerFacet.cs
- ToolStripDropTargetManager.cs
- Html32TextWriter.cs
- WebPartHelpVerb.cs
- WebCategoryAttribute.cs
- EditorPart.cs
- Thickness.cs
- AsnEncodedData.cs
- EditingCommands.cs
- MethodExecutor.cs
- HttpEncoderUtility.cs
- UIPermission.cs
- EventToken.cs