C#/vb.net 在picturebox中的画图函数button_click 可以触发,form load不可触发
Dim MyFormGraphic As Graphics = FormPic.CreateGraphics
Dim BlackPen As New Pen(Brushes.Black, 2) '线宽为2
Dim x As Integer
Dim y As Integer
Dim width As Integer = Piewidth
Dim height As Integer = Pieheight
x = (PicBoxWidth - width) / 2 '目前没用
y = (PicBoxHeight - height) / 2 '计算距离轴起点纵坐标
Dim StrF As New StringFormat()
StrF.FormatFlags = StringFormatFlags.DirectionVertical
MyFormGraphic.DrawString("( 范 围 Km )", New Font("Verdana", 10), Brushes.Blue, 10, 180, StrF)
For i = 0 To 10 Step 2
'画距离标尺 上半轴
Dim startb As New PointF(40, y + height / 2 - i * PicR / 10 - 10)
MyFormGraphic.DrawString(Convert.ToString(i * PerDis + DisMin), New Font("Verdana", 10), Brushes.Blue, startb)
'画距离刻度
Dim start2b As New PointF(80, y + i * PicR / 10)
Dim end2b As New PointF(89, y + i * PicR / 10)
MyFormGraphic.DrawLine(BlackPen, start2b, end2b) '画长刻度
Dim start2bb As New PointF(84, y + i * PicR / 10 + PicR / 10)
Dim end2bb As New PointF(89, y + i * PicR / 10 + PicR / 10)
MyFormGraphic.DrawLine(BlackPen, start2bb, end2bb) '画短刻度
Next i
这是什么原因