By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,091 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,091 IT Pros & Developers. It's quick & easy.

create panel or label field for each database records

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"QT" <we*****@yahoo.com> schrieb
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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a
"QT" <we*****@yahoo.com> schrieb
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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3

P: n/a
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
Nov 20 '05 #4

P: n/a
* "QT" <we*****@yahoo.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

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

Jim

"QT" <we*****@yahoo.com> wrote in message
news:OL**************@TK2MSFTNGP09.phx.gbl...
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

Nov 20 '05 #6

P: n/a
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

"James Radke" <jr*****@wi.rr.com> wrote in message
news:#P*************@tk2msftngp13.phx.gbl...
Why do you want a different panel for each database record? What are you
trying to accomplish?

Jim

"QT" <we*****@yahoo.com> wrote in message
news:OL**************@TK2MSFTNGP09.phx.gbl...
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


Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.