投稿日 | : 2003/09/11(Thu) 21:22 |
投稿者 | : 花ちゃん |
Eメール | : |
URL | : |
タイトル | : Re^3: オブジェクトの保存 |
これではどうでしょう?
長くなりますので必要部分のみ
'デフォルトカラーの保存用変数(動的配列にするなり適当に)
Private pColor(2, 2) As Long
'デフォルトカラーを取得及び保存(最初の表示時に適当な場所で)
Dim j As Long
j = -1
For Each series In MSChart1.Plot.SeriesCollection
With series.DataPoints(-1).Brush.FillColor
j = j + 1
pColor(j, 0) = .Red
pColor(j, 1) = .Green
pColor(j, 2) = .Blue
End With
Next
モノクロ表示の時にフラグを立てて、フラグが立っていたら下記を実施するの方がいいかも。
'元のパターンとカラーに戻して表示(プロシージャ化)
Private Sub mnuSolid_Click()
Dim series As Object
Dim j As Long
j = -1
For Each series In MSChart1.Plot.SeriesCollection
With series
j = j + 1
.DataPoints(-1).Brush.Style = VtBrushStyleSolid
.DataPoints(-1).Brush.FillColor.Red = pColor(j, 0)
.DataPoints(-1).Brush.FillColor.Green = pColor(j, 1)
.DataPoints(-1).Brush.FillColor.Blue = pColor(j, 2)
End With
Next
End Sub