1、动态增加的PictureBox1怎么设置大小?
2、我以下代码修改了panel背景色,怎么效果是这样呢,我想空间外都采用panel的背景色?

此主题相关图片如下:qq截图20181226095213.png

Dim pal1 As WinForm.Panel
pal1 =frm.CreateControl("Panel1",ControlTypeEnum.Panel)
pal1.dock = 1 '锚定
pal1.Height= 100 '页面高度
frm.AddControl(pal1) '增加Panel
pal1.BackColor = Color.Red '背景色
Dim pic As WinForm.PictureBox
pic = e.Form.CreateControl("PictureBox1", ControlTypeEnum.PictureBox)
pic.Left = 2
pic.Top = 20
e.Form.Controls("Panel1").AddControl(pic)
pic.BindingField = "账号密码.头像"
Dim lbl As WinForm.Label
lbl = e.Form.CreateControl("lable1", ControlTypeEnum.Label)
lbl.Text = "用户"
lbl.Left = 70
lbl.Top = 20
e.Form.AddControl(lbl)
lbl = e.Form.CreateControl("lable2", ControlTypeEnum.Label)
lbl.Text = "部门"
lbl.Left = 70
lbl.Top = 50
e.Form.AddControl(lbl)
lbl = e.Form.CreateControl("lable3", ControlTypeEnum.Label)
lbl.Text = "职务"
lbl.Left = 70
lbl.Top = 80
e.Form.AddControl(lbl)
e.Form.Controls("lable1").Text = "用户:" & _UserXingMing & ""
e.Form.Controls("lable2").Text = "部门:" & _UserGroup & ""
e.Form.Controls("lable3").Text = "职务:" & _UserPost &""
[此贴子已经被作者于2018/12/26 9:55:19编辑过]