create panel or label field for each database records

  • Thread starter Thread starter Armin Zingler
  • Start date Start date
A

Armin Zingler

QT said:
i = 1

Dim Panel(i) As System.Windows.Forms.Panel

Panel(i).BackColor = System.Drawing.SystemColors.ControlLightLight
Panel(i).Controls.Add(Me.lblAuditRef)
Panel(i).Location = New System.Drawing.Point(16, 24)
Panel(i).Name = "Panel1"
Panel(i).Size = New System.Drawing.Size(704, 24)
Panel(i).TabIndex = 0

But I am getting error. can't I make label field with (i) variable?
or how can I do?

Which error? Probably because you don't create a Panel.
 
Hi QT,

We can tell you how to correct that error, that is easy but then you have
every panel on the same place, with the same label.

Where do you want to have your labels?
What has to be on those labels as text

It is not so difficult to make what you ask.

Cor
 
* "QT said:
I want to create panel or label field for each database records. I am using
following codes for each database row to create panel field.

'Panel

'

i = 1

Dim Panel(i) As System.Windows.Forms.Panel

The line above should read '... As New System.Windows.Forms.Panel'.
But I am getting error. can't I make label field with (i) variable? or how
can I do?

Please post the error message in future.
 
Why do you want a different panel for each database record? What are you
trying to accomplish?

Jim
 
Dear sirs,

I want to create panel or label field for each database records. I am using
following codes for each database row to create panel field.

'Panel

'

i = 1

Dim Panel(i) As System.Windows.Forms.Panel

Panel(i).BackColor = System.Drawing.SystemColors.ControlLightLight

Panel(i).Controls.Add(Me.lblAuditRef)

Panel(i).Location = New System.Drawing.Point(16, 24)

Panel(i).Name = "Panel1"

Panel(i).Size = New System.Drawing.Size(704, 24)

Panel(i).TabIndex = 0

But I am getting error. can't I make label field with (i) variable? or how
can I do?

Best Regards
 
dear Jim,

Acctually I solve my problem with following codes;

Dim lblAuditStatus(i) As System.Windows.Forms.Label

lblAuditStatus(i) = New System.Windows.Forms.Label

lblAuditStatus(i).Location = New System.Drawing.Point(709, y)

lblAuditStatus(i).Name = "lblAuditStatus" & i

lblAuditStatus(i).Size = New System.Drawing.Size(90, 23)

lblAuditStatus(i).TabIndex = 1

lblAuditStatus(i).Text = myDataRow("Audit_Status")

lblAuditStatus(i).BackColor = BackColor



thanks
 
Back
Top