create multiple Check Boxes at run time
- From: "Jim Y" <j.s.yablonsky@xxxxxxxxxxxxxx>
- Date: Wed, 29 Jun 2005 16:43:39 GMT
I have not been able to get this to work. I have (in a test setup) 8 items in the MSFlexGrid filled
from a database. The first column has an identity number which I am attempting to display at each
Check Box. I want to provide the user with the option to delete those rows that the user selects
using the check box. The code below produces the last check box only. How do I get it to display
all 8 (or more depending upon the database)? What am I doing wrong? The code is producing one
check box as it goes through the For...Next and not creating 8 check boxes. Is there a better way
to remove selected rows from the grid and db?
Thank you,
Jim Y
' create CheckBox at run time - Maximum of 70 to display
Dim CheckBox As CheckBox
Dim ChkBox(1 To 70) As CheckBox
Dim iCBtop As Integer 'ChkBox top
Dim iCBleft As Integer 'ChkBox left
iCBtop = 4560
iCBleft = 720
iIndex = (Me.MSFlexGrid1.Rows - 1)
Set CheckBox = FrmMain.Controls.Add("VB.CheckBox", "NewCheckBox")
For iIndex = 1 To (Me.MSFlexGrid1.Rows - 1)
'Create Control Array of multiple check boxes for displayed items
' test with 8 displayed items - modify for 70 or more items
Set ChkBox(iIndex) = CheckBox
With ChkBox(iIndex)
.Visible = True
.Height = 255
.Width = 975
.Top = iCBtop '4560 to start
.Left = iCBleft '720 first column
.Caption = FrmMain.MSFlexGrid1.TextMatrix(iIndex, 1)
End With
iCBtop = iCBtop + 360
Next iIndex
.
- Follow-Ups:
- Re: create multiple Check Boxes at run time
- From: Jim Y
- Re: create multiple Check Boxes at run time
- From: Mike Williams
- Re: create multiple Check Boxes at run time
- From: neilanessa
- Re: create multiple Check Boxes at run time
- Prev by Date: Re: Skills required for transition from VB5 to VB6/VB.NET
- Next by Date: Value of variable disappearing???!!!!
- Previous by thread: Skills required for transition from VB5 to VB6/VB.NET
- Next by thread: Re: create multiple Check Boxes at run time
- Index(es):
Relevant Pages
|