create panel or label field for each database records

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.
 
C

Cor

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
 
H

Herfried K. Wagner [MVP]

* "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.
 
J

James Radke

Why do you want a different panel for each database record? What are you
trying to accomplish?

Jim
 
Q

QT

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
 
Q

QT

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top