Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Disabled graph doesn't use the XP theme colorset

When I set a graph's Enabled property to "false", the graph becomes grayed... It could be OK if my XP theme was gray based, but I use the "default" (blue) theme, for which the "control color" is a kind of "tan" or beige. Gray on beige, it looks weird!

Will there be a patch / service pack to fix that?

Thank you!
0 Kudos
Message 1 of 3
(3,592 Views)
We currently do not have any plans to release a patch for this behavior. I will file it as a suggestion for the next release. In the interim, you can get the XP style disabled look-and-feel by deriving a class from the particular graph that you are using (WaveformGraph or ScatterGraph). The sample code here shows how this can be done with a WaveformGraph, but you could accomplish with any other Measurement Studio .NET Windows Forms control.


public class MyWaveformGraph : WaveformGraph
{
protected override void OnPaint(PaintEventArgs e)
{
Draw(new ComponentDrawArgs(e.Graphics, ClientRectangle));

if (!Enabled)
{
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(128, SystemColors.ControlLightLight)), ClientRectangle);
}
}
}


All you need to do in your project is change the type of the designer created instance of the graph to MyWaveformGraph. The code above works with the default XP blue theme only.
Abhishek Ghuwalewala | Measurement Studio | National Instruments
0 Kudos
Message 2 of 3
(3,577 Views)
Thank you! That's what I was about to do. But instead of using SystemColors.ControlLightLight, I use SystemColors.Control, which gives a much nicer look that is very close to the disabled look of other Windows Forms controls.

Thank you again!
0 Kudos
Message 3 of 3
(3,569 Views)