説明

ピースのバー形状に、細くて上付き/下付きタイプの形状を指定することで、上下異なる色でピースを作成することができます。

対応

(例)
Private Sub Form_Load()
Dim itm As KnTViewLib.Item
Dim pce As KnTViewLib.Piece

With KnTView1
With .TimeScale
With .Large
.Unit = tivScaleUnitWeek
.Format = “yyyy年m月”
End With
With .Medium
.Unit = tivScaleUnitDay
.Format = “d”
.Fill.BackColor = vbWhite
End With
.Small.Hidden = True
.WidthPerScale = ScaleX(15, vbPixels, Me.ScaleMode)
End With
.ViewTopTime = “2000/7/6”

‘★パターン(その1)
Set itm = .Items.Add
itm.Cells(1).Value = “aaa”

Set pce = itm.Pieces.Add
With pce
.Start = “2000/7/8 15:00”
.Finish = “2000/7/12 15:00”
With .BarShape
.Shape = tivBarShapeUpperLine ‘★
With .Fill
.BackColor = vbMagenta
.Pattern = tivPattern3D
End With
End With
End With

Set pce = itm.Pieces.Add
With pce
.Start = “2000/7/10 0:00”
.Finish = “2000/7/13 22:00”
With .BarShape
.Shape = tivBarShapeLowerLine ‘★
With .Fill
.BackColor = vbGreen
.Pattern = tivPattern3D
End With
End With
End With

‘★パターン(その2)
Set itm = .Items.Add
itm.Cells(1).Value = “bbb”

Set pce = itm.Pieces.Add
With pce
.Start = “2000/7/8 15:00”
.Finish = “2000/7/12 15:00”
With .BarShape
.Shape = tivBarShapeUpperLine ‘★
With .Fill
.BackColor = vbMagenta
.Pattern = tivPattern3D
End With
End With
End With

Set pce = itm.Pieces.Add
With pce
.Start = “2000/7/10 0:00”
.Finish = “2000/7/13 22:00”
With .BarShape
.Shape = tivBarShapeLine ‘★
With .Fill
.BackColor = vbGreen
.Pattern = tivPattern3D
End With
End With
End With

‘★パターン(その3)
Set itm = .Items.Add
itm.Cells(1).Value = “ccc”

Set pce = itm.Pieces.Add
With pce
.Start = “2000/7/8 15:00”
.Finish = “2000/7/12 15:00”
With .BarShape
.Shape = tivBarShapeUpperRectangle ‘★
With .Fill
.BackColor = vbMagenta
.Pattern = tivPattern3D
End With
End With
End With

Set pce = itm.Pieces.Add
With pce
.Start = “2000/7/10 0:00”
.Finish = “2000/7/13 22:00”
With .BarShape
.Shape = tivBarShapeLowerRectangle ‘★
With .Fill
.BackColor = vbGreen
.Pattern = tivPattern3D
End With
End With
End With

‘★パターン(その4)
Set itm = .Items.Add
itm.Cells(1).Value = “ddd”

Set pce = itm.Pieces.Add
With pce
.Start = “2000/7/8 15:00”
.Finish = “2000/7/12 15:00”
With .BarShape
.Shape = tivBarShapeUpperRectangle ‘★
With .Fill
.BackColor = vbMagenta
End With
With .Line
.Color = RGB(255, 202, 228)
End With
End With
End With

Set pce = itm.Pieces.Add
With pce
.Start = “2000/7/10 0:00”
.Finish = “2000/7/13 22:00”
With .BarShape
.Shape = tivBarShapeLowerRectangle ‘★
With .Fill
.BackColor = vbGreen
End With
With .Line
.Color = RGB(202, 255, 202)
End With
End With
End With
End With
End Sub