Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

changing button style

Using Component works for vb.net, how do I change the style of an input button? I am dynamically creating buttons to indicate digital inputs, but the style defaults to an output toggle button. I want to change the style to a green/red led.

My code snippet is as follows:

For Each anIo In colIo 'I created a collection of IO tags
If anIo.nType = IoAcess.IoType.DIG_IN Then ' if this IO tag is a digital input
Dim cwbIn As AxCWUIControlsLib.AxCWButton
cwbIn = New AxCWUIControlsLib.AxCWButton

I want to insert here:
cwbIn.OffImage.CWImage.Picture = ???

MyBase.Controls.Add(cwbIn)

but I see no way of getting the picture resources out of a file and casted into the Component Works Picture structure.
0 Kudos
Message 1 of 2
(6,301 Views)
Check out the SetBuiltinStyle method of the CWButton control. This method takes a CWButtonStyles enumeration parameter that contains all of the styles that you can configure in the property pages at design-time.

It looks like you're .NET interop interfaces to the ActiveX controls. Just out of curiosity, is there a reason that you're using interop assemblies instead of the native Measurement Studio Windows Forms .NET controls?

- Elton
0 Kudos
Message 2 of 2
(6,294 Views)