Help modifying my dotnet radio button form

Author Message
lonniehailey@comcast.net

  • Total Posts : 9
  • Scores: 0
  • Reward points : 0
  • Joined: 9/22/2010
  • Status: offline
Help modifying my dotnet radio button form Thursday, September 30, 2010 2:23 PM (permalink)
0
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

 
#1
    rasimmer

    • Total Posts : 2363
    • Scores: 163
    • Reward points : 0
    • Joined: 3/19/2009
    • Location: Cedar Rapids, IA
    • Status: offline
    Re:Help modifying my dotnet radio button form Friday, October 01, 2010 12:29 AM (permalink)
    0
    Lonnie,

    This is VB.NET and this is a VBScript forum.  The admin will probably move this to the "Other Languages" section, but you should post this on a .NET forum to get a quick turn around.

    To attempt to answer, is there a particular reason that you are dynamically building the form versus just building the interface in the VS GUI?  Even if you don't want it to be that way permananently, I would build the form and record where all of the buttons are on the form (x,y) and then try to build it dynamically.
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9