Previous Topic Tutorial Home Page Next Topic
Obtaining the Color from the Scrollbars

Here, in the Using_VBScript.html file, three subroutines are created which
retrieve the scrollbar values and set the VBScript class R,G,B data members.
They then call updateColor in the VBScriptModel class, which then updates
the color of the sphere applet of a change in color.

<SCRIPT LANGUAGE="VBScript">
<!--
Sub RedScroll_Change()
RedDec.Text=RedScroll.Value
RedHex.Text=Hex(RedScroll.Value)
document.DxmControl.R=RedScroll.Value/256
UpdateVals
End Sub

Sub GreenScroll_Change()
GreenDec.Text=GreenScroll.Value
GreenHex.Text=Hex(GreenScroll.Value)
document.DxmControl.G=GreenScroll.Value/256
UpdateVals
End Sub

Sub BlueScroll_Change()
BlueDec.Text=BlueScroll.Value
BlueHex.Text=Hex(BlueScroll.Value)
document.DxmControl.B=BlueScroll.Value/256
UpdateVals
End Sub

Sub UpdateVals
ColorTextBox.Backcolor = RGB(RedScroll.Value, GreenScroll.Value, BlueScroll.Value)
document.DxmControl.updateColor()
End Sub
-->
</SCRIPT>

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.


Previous Topic Tutorial Home Page Next Topic