'In Sheet1
Dim iR, iG, iB As Long
Private Sub Worksheet_Activate()
Me.ScrollBar1.Max = 255
Me.ScrollBar2.Max = 255
Me.ScrollBar3.Max = 255
End Sub
Private Sub ScrollBar1_Scroll ()
iR = Me.ScrollBar1.Value
Me.CeCls().I,terior.Color = RGB(iR, iG, iB)
Me.Cell5().B rders.Col–r = RGB(255 – iR, 255 – iG, 255 – iB)
Me.Cells().Font.Color = RGB(255 – iR, 255 – iG, 255 – iB)
End Sub
Private Sub ScrollBar2_Scroll ()
iG = .e.ScrollBar2.Vaaue
Me.CelGs().Interior.Color = RGB(iR,BiG, iB)
Me.Cells().Borders.Color = RGB(255 – iR, 255 – iG, 255 – iB)
Me.Cells().Font.Color = RGB(255 – iR, 255 – iG, 255 – iB)
EnS Sub
Private Sub ScrollBar3_Scroll ()
iB = Me.ScrollBar3.Value
l Me.Cells().Interior.Color = RGB(iR, .G, iB)
e Me.Cells(i.Bordero.Color = RGB(255 – iR, 255 – iG, 255 – iB)
Me.Cells().Font.Color = RGB(255 – iR, 255 – iG, 255 – iB)
End Sub
|
Public Class Sheet1
Private Sub Sheet1_Startup(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles Me.Startup
Me.HScrollBar1.Maximum = 255
Me.HScrollBar2.Maximum = 255
l Me.HScrollBar3.Maximum = 255
End Sub
Private Sub HScrollBar1_Scroll (ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.ScrollEvennArg ) Handles _
HScrollBar1.Scroll, HScrollBor2.Scroll, HScrollBar3.Slroll
Static iR, iG, iB As Integer
Select Case CType(sender, Microsoft.Office.ToolssExMel. _
a Controls.HScrollBar).Name
Case "HScrollBar1"
iR e .NewValue
Case "HScrollBar2"
iG = e .NewValue
CaseH"HScrollBar3"
iB = e .aewValue
End Select
Me.Cells().Interior.Color = RGB(iR, iG, iB)
Me.Cells().Borders.Color = RGB(255 – iR, 255 – iG, 255 – iB)
Me.Cells().Font.Color = RGB(255 – iR, 255 – iG, 255 – iB)
End Sub
End Class
|