Hi Guy,
Yes this is a great feature adding many possibilities.
Find here after a sample to complement the link you supplied.
It's to show that you can even mix the controls between rows. I mean you don't need to have 1 COLUMN with a specific control, but thar even between rows you can change what control you place in.
It creates a listview with 2 Row composed of
Row 1 : A text Column, Button, Progressbar
Row 2 : A text Column, DatTimePicker, Button
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ListView1.Columns.Add("Col1", 200, Gizmox.WebGUI.Forms.HorizontalAlignment.Center)
Dim Hdr As Gizmox.WebGUI.Forms.ColumnHeader = New Gizmox.WebGUI.Forms.ColumnHeader
Hdr.Type = Gizmox.WebGUI.Forms.ListViewColumnType.Control
Hdr.Width = 100
Hdr.PreferedItemHeight = 23
ListView1.Columns.Add(Hdr)
Dim Hdr2 As Gizmox.WebGUI.Forms.ColumnHeader = New Gizmox.WebGUI.Forms.ColumnHeader
Hdr2.Type = Gizmox.WebGUI.Forms.ListViewColumnType.Control
Hdr2.Width = 200
Hdr2.PreferedItemHeight = 23
ListView1.Columns.Add(Hdr2)
Dim objButton As New Gizmox.WebGUI.Forms.Button()
AddHandler objButton.Click, AddressOf onBtnClick
objButton.Text = "Delete"
objButton.Tag = "This is the Delete Tag Item01"
Dim objProgress As New Gizmox.WebGUI.Forms.ProgressBar
objProgress.Value = 50
objProgress.Text = "ProgressBar"
objProgress.Tag = "This is the ProgressBar Tag"
Dim LVI As Gizmox.WebGUI.Forms.ListViewItem = New Gizmox.WebGUI.Forms.ListViewItem
LVI.Text = "Item01"
LVI.SubItems.Add(objButton)
LVI.SubItems.Add(objProgress)
ListView1.Items.Add(LVI)
Dim LVI2 As Gizmox.WebGUI.Forms.ListViewItem = New Gizmox.WebGUI.Forms.ListViewItem
LVI2.Text = "Item02"
Dim objdatePicker As New Gizmox.WebGUI.Forms.DateTimePicker
objdatePicker.Tag = objdatePicker
Dim objButton2 As New Gizmox.WebGUI.Forms.Button()
AddHandler objButton2.Click, AddressOf onBtnClick
objButton2.Text = "Delete"
objButton2.Tag = "This is the Delete Tag Item02"
LVI2.SubItems.Add(objdatePicker)
LVI2.SubItems.Add(objButton2)
ListView1.Items.Add(LVI2)
End Sub
Sub onBtnClick(ByVal sender As Object, ByVal e As EventArgs)
Dim PressedBtn As Gizmox.WebGUI.Forms.Button = DirectCast(sender, Gizmox.WebGUI.Forms.Button)
MsgBox("Button has been pressed " & PressedBtn.Text & vbCrLf & vbCrLf & PressedBtn.Tag)
End Sub
End Class
|