Example E3736
Visible to All Users

WPF Gauges - Set the Width and Height of Symbols in the Digital Gauge Control

This example demonstrates how to specify the width and height of digital gauge symbols in fixed and proportional values:

  1. Create an instance of the SymbolLength class and specify its settings.
  2. Assign this instance to SymbolViewBase.Height and SymbolViewBase.Width properties.

image

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

Example Code

MainWindow.xaml
XAML
<Window x:Class="Digital_Gauge.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dxga="http://schemas.devexpress.com/winfx/2008/xaml/gauges" Title="MainWindow" Height="350" Width="525"> <Grid> <dxga:DigitalGaugeControl Text="Hello!!!" VerticalAlignment="Center"> <dxga:DigitalGaugeControl.Layers> <dxga:DigitalGaugeLayer/> </dxga:DigitalGaugeControl.Layers> <dxga:DigitalGaugeControl.Model> <dxga:DigitalCleanWhiteModel/> </dxga:DigitalGaugeControl.Model> <dxga:DigitalGaugeControl.SymbolView> <dxga:MatrixView8x14 x:Name="matrixView"/> </dxga:DigitalGaugeControl.SymbolView> </dxga:DigitalGaugeControl> <Button Name="button1" Content="Set Fixed Size" Click="button1_Click" Height="30" Width="172" Margin="5,2,0,0" FontSize="14" HorizontalAlignment="Left" VerticalAlignment="Top" /> <Button Name="button2" Content="Set Proportional Size" Click="button2_Click" Height="30" Width="172" Margin="0,2,5,0" FontSize="14" HorizontalAlignment="Right" VerticalAlignment="Top" /> </Grid> </Window>
MainWindow.xaml.cs(vb)
C#
using System.Windows; using DevExpress.Xpf.Gauges; namespace Digital_Gauge { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { // Specify fixed values for symbol height and width. matrixView.Width = new SymbolLength(SymbolLengthType.Fixed, 44); matrixView.Height = new SymbolLength(SymbolLengthType.Fixed, 50); } private void button2_Click(object sender, RoutedEventArgs e) { // Specify proportional values for symbol height and width. matrixView.Width = new SymbolLength(SymbolLengthType.Proportional, 2); matrixView.Height = new SymbolLength(SymbolLengthType.Proportional, 5); } } }

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.