老师,我设置了窗口大小,每次显示5个控件,怎么让控件滚动显示,比如我第一次生成显示1-5的控件,通过计时器,怎么实现下一次显示2-6的控件。
Dim x = e.Form.BaseForm.Width
Dim frm = e.Form.Controls("panel1")
Dim zaj As List(Of String) = DataTables("表A").GetValues("第一列", "", "序号")
For Each za As String In zaj
Dim ajm As List(Of DataRow) = DataTables("表A").Select("第一列='" & za & "'", "序号")
For Each aj2 As DataRow In ajm
Dim aj As String = aj2("第一列")
' Dim jpg As String = aj2("图标")
Dim hsmc As String = aj2("第一列")
Dim abc As WinForm.Button
abc = e.Form.CreateControl(hsmc, ControlTypeEnum.button)
abc.Text = aj
abc.Dock = 3 '锚定
abc.Width = x/5 '按钮宽度
abc.Height = 100 '按钮高度
' abc.Image = GetImage(jpg) '图标
abc.ImageAlign = ContentAlignment.MiddleLeft '图标位置,靠左居中
abc.TextAlign = ContentAlignment.MiddleLeft '名称位置,靠左居中
abc.TextImageRelation = TextImageRelation.ImageBeforeText '图标在文本之前 Automatic '图标相对位置'自动
abc.VisualStyle = IVisualStyle.Office2010Black '按钮主题
frm.AddControl(abc)
Next
Next