Code:
/ DotNET / DotNET / 8.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
- RoleManagerEventArgs.cs
- GcHandle.cs
- SinglePhaseEnlistment.cs
- DataServiceConfiguration.cs
- SecurityCriticalDataForSet.cs
- AggregationMinMaxHelpers.cs
- ZipIOCentralDirectoryFileHeader.cs
- Vector3dCollection.cs
- AutomationPropertyInfo.cs
- _ScatterGatherBuffers.cs
- InitializationEventAttribute.cs
- DataColumnChangeEvent.cs
- ArrangedElement.cs
- NamespaceListProperty.cs
- Debug.cs
- StorageAssociationTypeMapping.cs
- OptimalTextSource.cs
- PersistenceTypeAttribute.cs
- RootProfilePropertySettingsCollection.cs
- Triangle.cs
- XmlSerializerSection.cs
- ObjectFullSpanRewriter.cs
- IListConverters.cs
- SerializationStore.cs
- ValueUtilsSmi.cs
- DataGridViewEditingControlShowingEventArgs.cs
- GeneralTransform3DTo2D.cs
- EventMap.cs
- DataGrid.cs
- HttpResponseHeader.cs
- Soap.cs
- StrokeCollection.cs
- TreeViewCancelEvent.cs
- DataBinder.cs
- TemplateNameScope.cs
- MimeImporter.cs
- XmlReader.cs
- DbParameterCollection.cs
- CompositeScriptReferenceEventArgs.cs
- SectionUpdates.cs
- Base64Encoder.cs
- WebPartMenuStyle.cs
- FilterElement.cs
- SettingsSection.cs
- KeyManager.cs
- RequiredFieldValidator.cs
- TextCompositionManager.cs
- RegexParser.cs
- Listener.cs
- TrustSection.cs
- Task.cs
- OracleTransaction.cs
- EntryPointNotFoundException.cs
- QuestionEventArgs.cs
- ListDesigner.cs
- ListSortDescriptionCollection.cs
- ConcurrentStack.cs
- MiniLockedBorderGlyph.cs
- ComponentResourceManager.cs
- WindowsFormsSynchronizationContext.cs
- BCryptNative.cs
- DESCryptoServiceProvider.cs
- KeyValueConfigurationElement.cs
- InlineCollection.cs
- Win32KeyboardDevice.cs
- BitArray.cs
- DataGridViewTopLeftHeaderCell.cs
- _BasicClient.cs
- RectangleGeometry.cs
- DefaultProxySection.cs
- RuntimeCompatibilityAttribute.cs
- IntranetCredentialPolicy.cs
- UriExt.cs
- ZoneButton.cs
- DataSysAttribute.cs
- XPathPatternParser.cs
- COM2ICategorizePropertiesHandler.cs
- GenericTypeParameterBuilder.cs
- CheckBoxPopupAdapter.cs
- BaseParser.cs
- EventRoute.cs
- EntityDesignerUtils.cs
- ComplexPropertyEntry.cs
- ObjectItemAttributeAssemblyLoader.cs
- FixedTextBuilder.cs
- MessageBox.cs
- AdornerPresentationContext.cs
- EdmType.cs
- ListMarkerSourceInfo.cs
- XmlSchemaAll.cs
- ObjectStateManager.cs
- ToolStripDropDown.cs
- TempFiles.cs
- ProxyGenerator.cs
- XpsSerializationManager.cs
- MediaPlayer.cs
- Invariant.cs
- SspiNegotiationTokenAuthenticator.cs
- GCHandleCookieTable.cs
- InstanceStore.cs