在窗体上画一个红色实心的三角形,用vb怎样写?谢谢。
1个回答
展开全部
以下资料来源于:
http://zhidao.baidu.com/question/50003104.html?fr=qrl&cid=867&index=3&fr2=query
Private Declare Function ExtFloodFill Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long, ByVal wFillType As Long) As Long
Private Sub Picture1_Click()
With Picture1
.FillColor = vbRed
.FillStyle = 0
.ForeColor = vbBlue
Picture1.Line (Picture1.ScaleLeft, Picture1.ScaleTop)-(Picture1.ScaleLeft + Picture1.ScaleWidth, Picture1.ScaleTop + Picture1.ScaleHeight / 2)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop + Picture1.ScaleHeight)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop)
End With
Call ExtFloodFill(Picture1.hdc, Picture1.ScaleLeft + 1, Picture1.ScaleTop + 1, vbBlue, 0)
End Sub
http://zhidao.baidu.com/question/50003104.html?fr=qrl&cid=867&index=3&fr2=query
Private Declare Function ExtFloodFill Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long, ByVal wFillType As Long) As Long
Private Sub Picture1_Click()
With Picture1
.FillColor = vbRed
.FillStyle = 0
.ForeColor = vbBlue
Picture1.Line (Picture1.ScaleLeft, Picture1.ScaleTop)-(Picture1.ScaleLeft + Picture1.ScaleWidth, Picture1.ScaleTop + Picture1.ScaleHeight / 2)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop + Picture1.ScaleHeight)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop)
End With
Call ExtFloodFill(Picture1.hdc, Picture1.ScaleLeft + 1, Picture1.ScaleTop + 1, vbBlue, 0)
End Sub
参考资料: http://zhidao.baidu.com/question/50003104.html?fr=qrl&cid=867&index=3&fr2=query
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询