Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: Problem with Propertygrid and fonts

$
0
0
There is already a built-in PropertyValueChanged event. I got it to work; however, some fonts don't update the stretch and style.

Thanks for the help!
        private void testPropertyGrid_PropertyValueChanged( object sender, Xceed.Wpf.Toolkit.PropertyGrid.PropertyValueChangedEventArgs e )
        {
            if ( e.OldValue != e.NewValue )
            {
                try
                {
                    // A lot of code just to update a font in a control.
                    testStringTextBox.FontFamily = preferences.EditorFont.Family;
                    testStringTextBox.FontSize = preferences.EditorFont.FontSize;
                    testStringTextBox.FontStretch = preferences.EditorFont.Stretch;
                    testStringTextBox.FontStyle = preferences.EditorFont.Style;
                    testStringTextBox.FontWeight = preferences.EditorFont.Weight;
                }
                catch(Exception ex)
                {
                    MessageBox.Show( ex.Message, "Exception Error", MessageBoxButton.OK, MessageBoxImage.Error );
                }
            }
        }

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>