Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Change the max range on the x axis measurement studio

Solved!
Go to solution

I am trying to change the x axis maximum range based on the user input from a textbox.  I am not sure how to do this.  If anyone has any insight, please let me know.  I am programming in C#.  

 

Thanks! 

0 Kudos
Message 1 of 5
(4,257 Views)

Hello - 

 

To do this, you'll need to create an assign a new Range object - something similar to the following:

 

 

waveformGraph1.XAxes[0].Range = new Range((double)numericUpDown1.Value,
    (double)numericUpDown2.Value);

 

 

NickB

National Instruments  

0 Kudos
Message 2 of 5
(4,255 Views)

Hi,

 

Thanks for getting back to me.  I used your code that you provided and it did not work.  Do I need to add something.  This is my code:

 

waveformGraphTap.XAxes[0].Range = new Range(0, 1000);

 

And I get the following error messages:

 

'System.Data.Range' is inaccessible due to its protection level 

The type 'System.Data.Range' has no constructors defined 

 

Thanks again for the help!

 

0 Kudos
Message 3 of 5
(4,253 Views)

Hello - 

 

It looks like you need to either add "using NationalInstruments.UI;" to the top of your source file, or you need to fully qualify your "new Range(0, 1000);" statement, so that it looks like "new NationalInstrument.UI.Range(0, 1000);"

 

NickB

National Instruments  

0 Kudos
Message 4 of 5
(4,251 Views)
Solution
Accepted by topic author tylow

Thank you that worked!! Thanks for the help!Smiley Happy

0 Kudos
Message 5 of 5
(4,246 Views)