Hi all
I am new to VB.Net, so please be gentle. I am natively an ASP.Net developer and wish to make a windows application to use in my place of business.
Requirements:
I have a database with a number of records in. I need to loop through these records in my application and list them in a particular order. I need a button next to each of the records to navigate through to another page for more information on the record. This list needs to be updated every n. seconds.
Where I am up to:
I have a timer which runs correctly every 5 seconds.
I have a successful database connection and have written a class to iterate through any records I tell it to. This is working as expected.
The problem:
I am attempting to use the following to write out my controls to the screen:
No matter what I try, each panel is overlayed on top of the last. I have tried adding a dynamic "top" (oPanel.Top = iTop / iTop += 30) to each panel which increases every time it iterates through the records, but this had no effect.
Thanks in advance. Do let me know if I have not provided enough information.
Ben
I am new to VB.Net, so please be gentle. I am natively an ASP.Net developer and wish to make a windows application to use in my place of business.
Requirements:
I have a database with a number of records in. I need to loop through these records in my application and list them in a particular order. I need a button next to each of the records to navigate through to another page for more information on the record. This list needs to be updated every n. seconds.
Where I am up to:
I have a timer which runs correctly every 5 seconds.
I have a successful database connection and have written a class to iterate through any records I tell it to. This is working as expected.
The problem:
I am attempting to use the following to write out my controls to the screen:
VB.NET:
For Each DR In SQL.Exec("sp_GetList").Tables(0).Rows
Dim oPanel As New Panel
Dim oLabel As New Label
oLabel.Text = DR("Record_Name")
Dim oButton As New Button
oButton.Text = "View"
oButton.Anchor = DR("Record_ID")
oButton.Left = 100
AddHandler oButton.Click, AddressOf DoButtonClick
oPanel.Controls.Add(oButton)
oPanel.Controls.Add(oLabel)
pnlList.Controls.Add(oPanel)
Next
No matter what I try, each panel is overlayed on top of the last. I have tried adding a dynamic "top" (oPanel.Top = iTop / iTop += 30) to each panel which increases every time it iterates through the records, but this had no effect.
Thanks in advance. Do let me know if I have not provided enough information.
Ben