PDA

View Full Version : Columns in ListView



eureka18
04-18-2011, 03:06 AM
Hello Everyone,

I am trying to follow the tutorial below.

http://www.vbdotnetheaven.com/Upload...ewControl.aspx (http://www.vbdotnetheaven.com/Uploadfile/mahesh/MultiColumnListViewControl04252005023924AM/MultiColumnListViewControl.aspx)

However, when I come to the point to add multiple columns. I get stuck..


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Adding ListView Columns
ListView1.Columns.Add("Emp Name", 100, HorizontalAlignment.Left)
ListView1.Columns.Add("Emp Address", 150, HorizontalAlignment.Left)ListView1.Columns.Add("Title", 60, HorizontalAlignment.Left)
ListView1.Columns.Add("Salary", 50, HorizontalAlignment.Left)ListView1.Columns.Add("Department", 60, HorizontalAlignment.Left)
End Sub


What is wrong with the code? Can anybody help me please?

Bob Phillips
04-18-2011, 10:44 AM
ARe you trying to do this with a form in Excel VBA? There is no Form_LOad event in an Excel userform.

eureka18
04-19-2011, 01:20 AM
thread also posted on: http://www.ozgrid.com/forum/showthread.php?t=152714&page=1&highlight=eureka18

please continue overthere