05-16-2013 11:13 AM
I used to use the CW button control in VB6 applications, which gave me momentary/maintained buttons. These were used to emulate a control panel and worked great.
Measurement Studio 2010 no longer has the button control, which I think is a great loss for any application development.
Is there a way of using the CW.button control in 2010?
Does any version of measurement studio, compatible with VS2010 C#, have similar button components?
05-16-2013 01:50 PM
Are you referring to the IsMomentary
property on the WPF BooleanButton
control, or the SwitchUntilReleased
value for the InteractionMode
property on the Windows Forms Boolean
control?
05-16-2013 02:10 PM
Hi Paul,
The SwitchUntilReleased for Windows Forms...
05-16-2013 03:17 PM
In that case, you can use the Switch
or Led
controls derived from Boolean
. For SwitchUntilReleased
, when you press the mouse down on the control, the Value
property is updated and the StateChanged
event is raised; when the mouse is released, Value
is reverted and StateChanged
is raised again.
05-17-2013 08:28 AM
Hi Paul,
Sorry but I don't know how to implement that.
Can you give me some exmple code in C#
I've got an LED button on the form but can't see how to use the SwitchUntilReleased
05-17-2013 09:48 AM
In code, you would use switch1.InteractionMode = BooleanInteractionMode.SwitchUntilReleased;
to set the interaction mode. In the designer, you can use the property grid, or the smart tag:
05-17-2013 10:56 AM
Hi Paul,
Got it. Sorry, I had an older version of mesurement studio installed. I've installed 2013 version and now it works
Thanks a lot for your advice!