VB中在picturebox控件中显示验证码

2024-11-25 17:32:05
推荐回答(3个)
回答1:

加一个按钮后试试这一段,看没有用
Private Sub Command1_Click()
Dim A As Long
Picture1.AutoRedraw = True
Picture1.Cls
Picture1.ForeColor = RGB(255, 0, 0)
Picture1.FontName = "宋体"
Picture1.FontSize = "48"
Randomize
A = Int(10 * Rnd)
Picture1.Print Tab(5); Str(A);

Randomize
A = Int(10 * Rnd)
Picture1.Print Tab(7); Str(A);

Randomize
A = Int(10 * Rnd)
Picture1.Print Tab(9); Str(A);

Randomize
A = Int(10 * Rnd)
Picture1.Print Tab(11); Str(A);

End Sub

回答2:

picturebox1.print "1234556"

回答3:

楼上说的对,picturebox1.print