So I'm having trouble resolving this issue...I went ot the MSDN KB 190670 which explains how to do this but it's not working the way I want...it's creating the controls (proven by running the test more than once) but they aren't displaying...can you take a look and see what's wrong?
General Declarations:
Main Bulk of Automation to make controls:Code:Private WithEvents cmdObject As VB.CommandButton Private WithEvents lblObject As VB.Label Private WithEvents txtObject As VB.TextBox
Code:Private Sub Finish() Dim X As Integer Dim lLeft As Integer Dim tLeft As Integer Dim bLeft As Integer Dim lbHeight As Integer Dim tHeight As Integer Dim lbTop As Integer Dim tTop As Integer Dim lWidth As Integer Dim tWidth As Integer Dim bWidth As Integer lLeft = 240 tLeft = 1560 bLeft = 3120 lbHeight = 255 tHeight = 285 lbTop = 360 tTop = 330 lWidth = 855 tWidth = 1095 bWidth = 975 For X = 1 To mcnt Set cmdObject = Controls.Add("VB.CommandButton", "cmd" & X, SystemReq) cmdObject.Height = lbHeight cmdObject.Left = bLeft cmdObject.Top = lbTop cmdObject.Width = bWidth cmdObject.Visible = True cmdObject.Caption = "Info" SystemReq.Refresh Set txtObject = Controls.Add("VB.TextBox", "text" & X, SystemReq) txtObject.Height = tHeight txtObject.Left = tLeft txtObject.Top = tTop txtObject.Width = tWidth txtObject.Visible = True txtObject.Alignment = 2 txtObject.Text = resArray(X) SystemReq.Refresh Set lblObject = Controls.Add("VB.Label", "label" & X, SystemReq) lblObject.Height = lbHeight lblObject.Left = lLeft lblObject.Top = lbTop lblObject.Width = lWidth lblObject.Visible = True lblObject.Caption = marray(X) SystemReq.Refresh lbTop = lbTop + 360 tTop = tTop + 360 SystemReq.Refresh Next DispWindow.Text = "The Test has completed, please view the results below."




Reply With Quote