10-24-2012 09:25 AM
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
10-25-2012 05:52 AM - edited 10-25-2012 05:54 AM
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
10-26-2012 06:18 AM
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
11-29-2012 07:52 AM
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
12-04-2012 11:11 AM - edited 12-04-2012 11:13 AM
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
12-04-2012 11:44 AM
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
12-04-2012 11:52 AM - edited 12-04-2012 11:53 AM
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).
12-04-2012 12:02 PM
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
12-04-2012 01:02 PM - edited 12-04-2012 01:02 PM
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.
12-04-2012 01:05 PM
Thanks, but where do I get the license key from?
Liam