Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Slider width

Hi,

We're testing the slider control in the trial version of Measurment Studio 2010.NET. We've noticed that the width of the slider changes depending on the range property set. If we set the range from say 1 to 1000 the width of the slider decreases. Is there any way to keep the width of the slider constant irrespective of the range value?

 

Thanks

Liam

0 Kudos
Message 1 of 12
(6,222 Views)

Hi Liam

 

The slider class has a property width which you can use to get/set the width of a slider programmatically.

See http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/43a9867d/

 

Kind Regards

Chris | Applications Engineer NIUK
0 Kudos
Message 2 of 12
(6,214 Views)

Hi again Liam

 

I've had a play with this in my own development environment and can confirm the behaviour you have described.

I've found the easiest way to deal with this is to simply drag the slider to the desired width in the design view after managing the scale.

Alternatively I was able to manage the width via the Layout > Size > Width property.

 

Kind regards

Chris | Applications Engineer NIUK
0 Kudos
Message 3 of 12
(6,192 Views)

Hi Chris,

 

I have the same issue with the latest slider. I cannot find a way to have the scale a specific size no matter how many decimal we have.

I used v8 before and there is a way to do it. In the Properties->Format there is a Width that can be set from Auto, 0, 1, ..., 10. Then the slider will have the same width no matter if the range is set from 0 to 10 or 0 to 10000.

Is any similar way to do it in the latest Slider control (v12). Did you remove this option between versions?

 

(in the attachment I gave you an example on how on v8 size is the same (bottom controls). The top controls are from latest version (v12))

 

Please let me know ASAP. Using slider is the only reason why I would buy the package. Otherwise it is not useful for me.

 

 

P.S. I do not understand this:

 

"I've found the easiest way to deal with this is to simply drag the slider to the desired width in the design view after managing the scale.

Alternatively I was able to manage the width via the Layout > Size > Width property."

 

Can you give me more details? Again, my intention is to keep the stick from the slider object the same size. Using Size->Width property will resize the control's width.

My scale is dynamically created and it is after the controls are created

 

I hope I will get an answer soon

 

Regards,

Lucian

0 Kudos
Message 4 of 12
(6,133 Views)

Hi Lucian,

 

Unfortunately, there is no way to independently adjust the width of the Slide control and the width of the scale. The Slide control does not expose the individual components to allow customization. This is a feature we will be looking at for future versions.

 

Since you have worked with the ActiveX CWSlide version of this control in the past, you can actually use that in your Windows Form.

 

Using Measurement Studio ActiveX Controls in Visual Studio .NET

National Instruments
0 Kudos
Message 5 of 12
(6,104 Views)

Thanks for the reply. What about the license? How is this implemented in .NET for a V8 ActiveX control?

Also we used V6 previously and we'll need to purchase the V8 ActiveX controls. How do we do this and what is the price? We are based in Dublin, Ireland.

 

 

Thanks

Liam

0 Kudos
Message 6 of 12
(6,095 Views)

You will need to contact your local sales representative for pricing information. You can find your local representative through ni.com/contact.

 

In order to get access to the ActiveX controls, you will need to request the Measurement Studio for Legacy Environments and Langauges package (this requires purchasing the latest version of Measurement Studio). This will allow you to license the controls. In Visual Studio, the licensing for ActiveX controls is pretty automatic. Just drop the control in the designer, and VS takes care of the rest (assuming you have an active license on that system).

 

National Instruments
0 Kudos
Message 7 of 12
(6,092 Views)

We've only purchased the V6 version previously as our application was originally written in VC++6. With V6 we had to use a license number when dynamically creating the controls. Now, if I undersand correctly, the license is attached to the developer PC and doesn't need to be entered in our application?

 

This is how we implemented the license with V6:

 

static WCHAR pwchLKeyicense[] =
{
    0x006D,    0x0066,    0x0066,    0x0068,    0x0063,    0x0065,   
    0x006E,    0x0064,    0x006E,    0x0061,    0x006E,    0x0068,   
    0x006E,    0x0070,    0x006F,    0x0066,    0x0069,    0x0061,   
    0x0067,    0x006C,    0x006E,    0x006C,    0x0068,    0x006F,   
    0x0067,    0x0069,    0x0061,    0x0067,    0x0064,    0x006F,   
    0x0064,    0x0063,    0x0068,    0x0070,    0x006D,    0x0067,   
    0x006A,    0x0064,    0x006E,    0x0063,    0x0064,    0x0063,   
    0x006E,    0x006B,    0x006C,    0x0061,    0x006E,    0x0061,   
    0x0070,    0x006E,    0x0065,    0x006F,    0x006D,    0x006A,   
    0x0064,    0x0067,    0x006B,    0x006A,    0x006E,    0x0066,   
    0x0065,    0x006B,    0x0067,    0x0066
};

 

 

BSTR bstrLic;
    bstrLic = ::SysAllocStringLen(
        pwchLKeyicense, sizeof( pwchLKeyicense ) / sizeof(WCHAR) );
    m_pCWGraph = new CCWGraph();
    if( !m_pCWGraph->Create( _T(""), WS_VISIBLE, CRect(0, 0, 0, 0), this,
        IDC_CWGRAPH1, NULL, FALSE, bstrLic) )
    {
        AfxMessageBox(IDS_CREATEGRAPH_FAILED, MB_OK | MB_ICONSTOP);
        ::SysFreeString(bstrLic);
        return FALSE;
    }
    ::SysFreeString(bstrLic);

 

Thanks

Liam

0 Kudos
Message 8 of 12
(6,086 Views)

You are right, if you are dynamically creating the control in .NET you will have to use a similar process as you did in VC. I am not familiar with this process in .NET, but I did find this article from Microsoft: How to dynamically add ActiveX controls that require run-time licenses in Visual C# .NET or in Visua...

 

My suggestion was referring to creating the UI in the designer.

National Instruments
0 Kudos
Message 9 of 12
(6,080 Views)

Thanks, but where do I get the license key from?

 

Liam

0 Kudos
Message 10 of 12
(6,077 Views)