Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / ButtonInternal / RadioButtonStandardAdapter.cs / 1 / RadioButtonStandardAdapter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.ButtonInternal { using System; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; using System.Windows.Forms; internal class RadioButtonStandardAdapter : RadioButtonBaseAdapter { internal RadioButtonStandardAdapter(ButtonBase control) : base(control) {} internal override void PaintUp(PaintEventArgs e, CheckState state) { if (Control.Appearance == Appearance.Button) { ButtonAdapter.PaintUp(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { ColorData colors = PaintRender(e.Graphics).Calculate(); LayoutData layout = Layout(e).Layout(); PaintButtonBackground(e, Control.ClientRectangle, null); PaintImage(e, layout); DrawCheckBox(e, layout); PaintField(e, layout, colors, colors.windowText, true); } } internal override void PaintDown(PaintEventArgs e, CheckState state) { if (Control.Appearance == Appearance.Button) { ButtonAdapter.PaintDown(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { PaintUp(e, state); } } internal override void PaintOver(PaintEventArgs e, CheckState state) { if (Control.Appearance == Appearance.Button) { ButtonAdapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { PaintUp(e, state); } } private new ButtonStandardAdapter ButtonAdapter { get { return ((ButtonStandardAdapter)base.ButtonAdapter); } } protected override ButtonBaseAdapter CreateButtonAdapter() { return new ButtonStandardAdapter(Control); } #region Temp protected override LayoutOptions Layout(PaintEventArgs e) { LayoutOptions layout = CommonLayout(); layout.hintTextUp = false; layout.everettButtonCompat = !Application.RenderWithVisualStyles; // VSWhidbey 420870 if (Application.RenderWithVisualStyles) { using (Graphics g = WindowsFormsUtils.CreateMeasurementGraphics()) { layout.checkSize = RadioButtonRenderer.GetGlyphSize(g, RadioButtonRenderer.ConvertFromButtonState(GetState(), Control.MouseIsOver)).Width; } } return layout; } #endregion } } // 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
- ToolStripRenderer.cs
- SqlConnectionHelper.cs
- FileUtil.cs
- ListItemCollection.cs
- PageRequestManager.cs
- IndentedWriter.cs
- Command.cs
- DataListGeneralPage.cs
- ApplicationSecurityInfo.cs
- SmtpException.cs
- PeerInputChannel.cs
- SID.cs
- OpenFileDialog.cs
- log.cs
- PolygonHotSpot.cs
- TextPattern.cs
- ScrollProviderWrapper.cs
- TailCallAnalyzer.cs
- SymbolEqualComparer.cs
- WeakEventManager.cs
- Win32Exception.cs
- DependentList.cs
- XmlPreloadedResolver.cs
- CodeDomConfigurationHandler.cs
- SiteMapDataSource.cs
- ConnectionPointCookie.cs
- IdentityReference.cs
- ParameterCollection.cs
- HeaderedItemsControl.cs
- DataRecordInfo.cs
- CopyAction.cs
- _DomainName.cs
- CodeSpit.cs
- FlowDocumentScrollViewer.cs
- QilParameter.cs
- Emitter.cs
- HwndSourceParameters.cs
- ToolStripLocationCancelEventArgs.cs
- AssociationProvider.cs
- OperatingSystem.cs
- MouseActionValueSerializer.cs
- OrCondition.cs
- RelatedEnd.cs
- ProfileService.cs
- ErrorHandler.cs
- OrderPreservingSpoolingTask.cs
- FileReader.cs
- ToolStripGripRenderEventArgs.cs
- EntityStoreSchemaGenerator.cs
- CodeIndexerExpression.cs
- WebPartTransformerCollection.cs
- CodeBlockBuilder.cs
- ExpandedWrapper.cs
- SiteMapDataSourceView.cs
- UdpUtility.cs
- MediaContext.cs
- CreatingCookieEventArgs.cs
- AQNBuilder.cs
- ToolStripTextBox.cs
- Int64Animation.cs
- PlainXmlDeserializer.cs
- IFlowDocumentViewer.cs
- DataGridCell.cs
- SymmetricKey.cs
- XmlSchemaImporter.cs
- ModuleElement.cs
- DBNull.cs
- WindowsPrincipal.cs
- HttpErrorTraceRecord.cs
- ReverseInheritProperty.cs
- CodeConstructor.cs
- WebPartDeleteVerb.cs
- DocumentPaginator.cs
- RelationshipWrapper.cs
- EmptyControlCollection.cs
- ZoneMembershipCondition.cs
- BufferedGraphicsManager.cs
- TimeEnumHelper.cs
- HttpPostLocalhostServerProtocol.cs
- ProcessProtocolHandler.cs
- FixedFlowMap.cs
- storagemappingitemcollection.viewdictionary.cs
- MultipartIdentifier.cs
- Formatter.cs
- CaseInsensitiveHashCodeProvider.cs
- Int64AnimationBase.cs
- SearchExpression.cs
- SerializationSectionGroup.cs
- WizardStepBase.cs
- BooleanConverter.cs
- ThreadPool.cs
- ExtendedPropertyDescriptor.cs
- Constraint.cs
- CmsUtils.cs
- RelOps.cs
- TrustLevelCollection.cs
- DragAssistanceManager.cs
- PixelShader.cs
- VersionUtil.cs
- ExpandSegmentCollection.cs