以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  关于picturebox的属性  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=92844)

--  作者:chenjiu6202
--  发布时间:2016/11/14 20:33:00
--  关于picturebox的属性
Private pictureBox1 As New PictureBox()
Public Sub CreateBitmapAtRuntime() 
    pictureBox1.Size = New Size(210, 110)
    Me.Controls.Add(pictureBox1)
    Dim flag As New Bitmap(200, 100)
    Dim flagGraphics As Graphics = Graphics.FromImage(flag)
    Dim red As Integer = 0
    Dim white As Integer = 11
    While white <= 100
        flagGraphics.FillRectangle(Brushes.Red, 0, red, 200, 10)
        flagGraphics.FillRectangle(Brushes.White, 0, white, 200, 10)
        red += 20
        white += 20
    End While
    pictureBox1.Image = flag
End Sub 

以上是msdn的一个例子,为什么ft就没有Graphics和size属性呢?

--  作者:有点蓝
--  发布时间:2016/11/14 20:46:00
--  
测试没有问题,只要是vb.net的代码都可以在foxtable里使用

窗口按钮事件
Dim pictureBox1 As New system.windows.Forms.PictureBox()
pictureBox1.Size = New Size(210, 110)
e.Form.panel.controls.add(pictureBox1)
Dim flag As New Bitmap(200, 100)
Dim flagGraphics As Graphics = Graphics.FromImage(flag)
Dim red As Integer = 0
Dim white As Integer = 11
While white <= 100
    flagGraphics.FillRectangle(Brushes.Red, 0, red, 200, 10)
    flagGraphics.FillRectangle(Brushes.White, 0, white, 200, 10)
    red += 20
    white += 20
End While
pictureBox1.Image = flag

--  作者:chenjiu6202
--  发布时间:2016/11/14 21:07:00
--  
谢谢,我测试一下