I am trying to modify my DotNet Radio Button Form. The form is working but I need to modify it as indicated by my
attachment. I am having trouble adding adding and positioning the objects on the form.
FYI: This input form is being used as a user interface for QTP
The existing code is below:
----------------------------------------------
Set frmMain = DotNetFactory.CreateInstance("System.Windows.Forms.Form", "System.Windows.Forms")
Set btnClose = DotNetFactory.CreateInstance("System.Windows.Forms.Button", "System.Windows.Forms")
Set radio1 = DOTNetFactory.CreateInstance(" System.Windows.Forms.RadioButton", "System.Windows.Forms")
Set radio2 = DOTNetFactory.CreateInstance(" System.Windows.Forms.RadioButton", "System.Windows.Forms")
Set radio3 = DOTNetFactory.CreateInstance(" System.Windows.Forms.RadioButton", "System.Windows.Forms")
Set radioLoc1 = DotNetFactory.CreateInstance("System.Drawing.Point", "System.Drawing", x, y)
Set radioLoc2 = DotNetFactory.CreateInstance("System.Drawing.Point", "System.Drawing", x, y)
Set radioLoc3 = DotNetFactory.CreateInstance("System.Drawing.Point", "System.Drawing", x, y)
Set lbl = DOTNetFactory.CreateInstance("System.Windows.Forms.Label", "System.Windows.Forms")
Set lblLoc = DotNetFactory.CreateInstance("System.Drawing.Point", "System.Drawing", x, y)
'______________________________________________________________
'Label Location
With lblLoc
.x = 10
.y = 10
End With
'Label Location
With lblLoc
.x = 30
.y = 30
End With
'Label Properties
With lbl
.Text = "Label Property"
'Give the checkbox a name property
.Name = "LabelSample"
.Location = lblLoc1
End With
'Radio Button Location
With radioLoc1
.x = 50
.y = 20
End With
With radioLoc2
.x = 50
.y = 40
End With
With radioLoc3
.x = 50
.y = 60
End With
'______________________________________________________________
'Radio Button Properties
With radio1
.Text = "Yes"
'Give the checkbox a name property
.Name = "radioSample1"
.Location = radioLoc1
End With
With radio2
.Text = "No"
'Give the checkbox a name property
.Name = "radioSample2"
.Location = radioLoc2
End With
With radio3
.Text = "Maybe"
'Give the checkbox a name property
.Name = "radioSample3"
.Location = radioLoc3
End With
'______________________________________________________________
'Button Location
With radioLoc1
.x = 100
.y = 160
End With
'Button Properties
With btnClose
.Location = radioLoc1
.Width = 50
.Text = "Close Form"
End With
'______________________________________________________________
'Add Controls
With frmMain
.Controls.Add lbl
.Controls.Add radio1
.Controls.Add radio2
.Controls.Add radio3
.Text = "Logon To Java Client"
'Adding a Cancel Button
.CancelButton = btnClose
.Controls.Add btnClose
End With
'-------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------
'Show Dialog
frmMain.ShowDialog
If radio1.Checked Then
DataTable.Value("Logon", "Global") = "Yes"
ElseIf radio2.Checked Then
DataTable.Value("Logon", "Global") = "No"
End If
If radio2.Checked Then
DataTable.Value("Logon", "Global") = "No"
End If
If radio3.Checked Then
DataTable("Van", "Global") = "Astro"
End If