VB编K线
本人近来学习用VB编显示股票的小软件,用的是“Graph”外接控件,K线显示效果不是佷好,高手们有没有好的方法或控件,本人先谢了。
[解决办法]
直接用line画。
[解决办法]
本帖最后由 bcrun 于 2012-12-02 15:19:49 编辑
Public Sub KLine()
Dim i As Integer
Dim BaseLine As Integer
BaseLine = BaseLine1
Dim color1
Dim color2
If mnuHLNet.Checked Then
color1 = vbGreen
color2 = vbYellow
Else
color1 = vbBlue
color2 = vbRed
End If
For i = Begin To FileLength
If zhb(i).ope > zhb(i).clo Then
picGraphic.Line ((i - Begin + 1) * Expx, BaseLine - (zhb(i).hig - low) * Expy)-((i - Begin + 1) * Expx, BaseLine - (zhb(i).ope - low) * Expy), color1
picGraphic.Line ((i - Begin + 1) * Expx - Expx / 2.5, BaseLine - (zhb(i).ope - low) * Expy)-((i - Begin + 1) * Expx + Expx / 2.5, BaseLine - (zhb(i).clo - low) * Expy), color1, BF
picGraphic.Line ((i - Begin + 1) * Expx, BaseLine - (zhb(i).low - low) * Expy)-((i - Begin + 1) * Expx, BaseLine - (zhb(i).clo - low) * Expy), color1
Else
picGraphic.Line ((i - Begin + 1) * Expx, BaseLine - (zhb(i).low - low) * Expy)-((i - Begin + 1) * Expx, BaseLine - (zhb(i).ope - low) * Expy), color2
picGraphic.Line ((i - Begin + 1) * Expx - Expx / 2.5, BaseLine - (zhb(i).ope - low) * Expy)-((i - Begin + 1) * Expx + Expx / 2.5, BaseLine - (zhb(i).clo - low) * Expy), color2, B
picGraphic.Line ((i - Begin + 1) * Expx, BaseLine - (zhb(i).hig - low) * Expy)-((i - Begin + 1) * Expx, BaseLine - (zhb(i).clo - low) * Expy), color2
End If
Next
End Sub