Code | nametable = {
"John",
"Bob",
"Tony",
"Spencer Henslol (That cool guy)",
"Joseph",
"Pikachu"
} //Cute little table of some names.
frame = vgui.Create("DFrame") // Create base frame to put the DListView on.
frame:SetSize(400,400)
frame:SetPos(100,100)
listmenu = vgui.Create("DListView") // Create the DListView
listmenu:SetParent(frame)
listmenu:SetSize(300,300)
listmenu:SetPos(5,20)
listmenu:AddColumn("Name") // Add a Column with the name 'Name'
for k,v in pairs(nametable) do // For every item in the nametable table, do the following:
listmenu:AddLine(v) // Add the string from the table, to a new row on the DListView.
end
function DeleteRow()
listmenu:RemoveLine(3) // Remove the third row from the DListView
end
concommand.Add("DeleteRow",DeleteRow) //Add a "DeleteRow" command to console to remove the third row. |