Tuesday, 6 July 2021

To Create dialog box before execution

Set objForm = DotNetFactory.CreateInstance("System.Windows.Forms.Form", "System.Windows.Forms")
Set objStartPos = DotNetFactory.CreateInstance("System.Windows.Forms.FormStartPosition","System.Windows.Forms")
Set objRd1 = DotNetFactory.CreateInstance("System.Windows.Forms.RadioButton", "System.Windows.Forms")
Set objRd2 = DotNetFactory.CreateInstance("System.Windows.Forms.RadioButton", "System.Windows.Forms")
Set objRd3 = DotNetFactory.CreateInstance("System.Windows.Forms.RadioButton", "System.Windows.Forms")
Set objRd4 = DotNetFactory.CreateInstance("System.Windows.Forms.RadioButton", "System.Windows.Forms")

Set objGb = DotNetFactory.CreateInstance("System.Windows.Forms.GroupBox", "System.Windows.Forms")
Set objBtn2 = DotNetFactory.CreateInstance("System.Windows.Forms.Button", "System.Windows.Forms")
x=10
y=10
Set p1 = DotNetFactory.CreateInstance("System.Drawing.Point","System.Drawing",x,y) 'This will provide the locations(X,Y) for the controls

objGb.Location=p1
objGb.Width=225
objGb.height=175

objRd1.Text="Normal Suite"
objRd1.Width = 150
objRd1.Height = 40
p1.x=30
p1.Y=30
objRd1.Location=p1

p1.x=30
p1.Y=60
objRd2.Width = 150
objRd2.Height = 40
objRd2.Location=p1
objRd2.Text="Smoke Suite"

p1.x=30
p1.Y=90
objRd3.Width = 150
objRd3.Height = 40
objRd3.Location=p1
objRd3.Text="Lite Regression Suite"
p1.x=30
p1.Y=120
objRd4.Width = 150
objRd4.Height = 40
objRd4.Location=p1
objRd4.Text="Full Regression Suite"

objGb.Text="Select The Type of Execution"
objGb.Controls.Add(objRd1)
objGb.Controls.Add(objRd2)
objGb.Controls.Add(objRd3)
objGb.Controls.Add(objRd4)
objBtn2.Text="Ok"

p1.X=60
p1.Y=CInt(objGb.Height)+50

objBtn2.Location=p1
objForm.CancelButton=objBtn2

objForm.Controls.Add(objGb)
objForm.Controls.Add(objBtn2)
objForm.StartPosition=objStartPos.CenterScreen
objForm.Text="Please select an option to continue execution"
objForm.ShowDialog
Flag="N"
If objRd1.Checked Then
Typeofexe="All"
ElseIf objRd2.Checked Then
Typeofexe="Smoke"
ElseIf objRd3.Checked Then
Typeofexe="Lite"
ElseIf objRd4.Checked Then
Typeofexe="Full"
End If

No comments:

Post a Comment