private void AddColumn(string title) { ColumnHeader column = new ColumnHeader(); column.Text = title; this.ListView.Columns.Add(column); }
private void AddColumn(string title) { bool odd = (this.ListView.Columns.Count & 1) > 0; Color headingColour1 = new Color(0.09f, 0.13f, 0.14f); Color headingColour2 = new Color(0.13f, 0.19f, 0.20f); ColumnHeader column = new ColumnHeader(); column.BackColor = odd ? headingColour1 : headingColour2; column.Text = title; this.ListView.Columns.Add(column); }
private void AddTestData() { if (this.ListView != null) { this.ListView.SuspendLayout(); { this.ListView.ItemBecameVisible += this.OnItemBecameVisible; this.ListView.ItemBecameInvisible += this.OnItemBecameInvisible; ColumnHeader ShipSpeciesColumn = new ColumnHeader(); ShipSpeciesColumn.Text = "Species"; this.ListView.Columns.Add(ShipSpeciesColumn); ColumnHeader ShipNameColumn = new ColumnHeader(); ShipNameColumn.Text = "Ship Name"; this.ListView.Columns.Add(ShipNameColumn); ColumnHeader AmountInFleetColumn = new ColumnHeader(); AmountInFleetColumn.Text = "Amount In Fleet"; this.ListView.Columns.Add(AmountInFleetColumn); for (int i = 0; i < 200; i++) { AddListViewItem("AndrosynthGuardianIcon", "Androsynth", "Guardian"); AddListViewItem("ArilouSkiffIcon", "Arilou", "Skiff"); AddListViewItem("ChenjesuBroodhomeIcon", "Chenjesu", "Broodhome"); AddListViewItem("ChmmrAvatarIcon", "Chmmr", "Avatar"); AddListViewItem("UrQuanDreadnoughtIcon", "Ur-Quan", "Dreadnought"); AddListViewItem("DruugeMaulerIcon", "Druuge", "Mauler"); AddListViewItem("EarthlingCruiserIcon", "Earthling", "Cruiser"); AddListViewItem("KorAhMarauderIcon", "Kor-Ah", "Marauder"); AddListViewItem("MelnormeTraderIcon", "Melnorme", "Trader"); AddListViewItem("MmrnmhrmXForm", "Mmrnmhrm", "X-Form"); AddListViewItem("MyconPodshipIcon", "Mycon", "Podship"); AddListViewItem("OrzNemesisIcon", "Orz", "Nemesis"); AddListViewItem("PkunkFuryIcon", "Pkunk", "Fury"); AddListViewItem("ShofixtiScoutIcon", "Shofixti", "Scout"); AddListViewItem("SlylandroProbeIcon", "Slylandro", "Probe"); AddListViewItem("SpathiEluderIcon", "Spathi", "Eluder"); AddListViewItem("SupoxBladeIcon", "Supox", "Blade"); AddListViewItem("SyreenPenetratorIcon", "Syreen", "Penetrator"); AddListViewItem("ThraddashTorchIcon", "Thraddash", "Torch"); AddListViewItem("UmgahDroneIcon", "Umgah", "Drone"); AddListViewItem("UtwigJuggerIcon", "Utwig", "Jugger"); AddListViewItem("VUXIntruderIcon", "VUX", "Intruder"); AddListViewItem("YehatTerminatorIcon", "Yehat", "Terminator"); AddListViewItem("ZoqFotPikStingerIcon", "ZoqFotPik", "Stinger"); } } this.ListView.ResumeLayout(); } }
private void AddTestData() { ListView[] listViews = new ListView[] { this.ListView1, this.ListView2 }; foreach (ListView listView in listViews) { if (listView != null) { listView.SuspendLayout(); { ColumnHeader NameColumn = new ColumnHeader(); NameColumn.Text = "From"; listView.Columns.Add(NameColumn); ColumnHeader DescriptionColumn = new ColumnHeader(); DescriptionColumn.Text = "Subject"; listView.Columns.Add(DescriptionColumn); ColumnHeader EffectsColumn = new ColumnHeader(); EffectsColumn.Text = "Date"; listView.Columns.Add(EffectsColumn); ColumnHeader PriceColumn = new ColumnHeader(); PriceColumn.Text = "Size"; listView.Columns.Add(PriceColumn); this.columnWidthStates = new int[this.columnCount]; AddListViewItem(listView, "Olympia Sykes", "*****@*****.**", "lectus ante dictum mi, ac mattis velit"); AddListViewItem(listView, "Neil Patton", "*****@*****.**", "vel sapien imperdiet ornare. In"); AddListViewItem(listView, "Melvin Dickerson", "*****@*****.**", "elementum purus, accumsan interdum libero dui"); AddListViewItem(listView, "Kevin Lyons", "*****@*****.**", "quis diam luctus lobortis."); AddListViewItem(listView, "Macy Frederick", "*****@*****.**", "ut, molestie in, tempus"); AddListViewItem(listView, "Nash Rios", "*****@*****.**", "dictum eu, placerat"); AddListViewItem(listView, "Erasmus Moran", "*****@*****.**", "lorem, eget mollis lectus pede et"); AddListViewItem(listView, "Sydnee Vargas", "*****@*****.**", "id, mollis nec, cursus a, enim. Suspendisse aliquet, sem"); AddListViewItem(listView, "Zahir Knight", "*****@*****.**", "malesuada. Integer id magna et ipsum cursus vestibulum. Mauris magna."); AddListViewItem(listView, "Rhonda Powers", "*****@*****.**", "elementum purus, accumsan interdum"); AddListViewItem(listView, "Whoopi Harrington", "*****@*****.**", "pulvinar arcu et pede. Nunc sed"); AddListViewItem(listView, "Kiona Cooley", "*****@*****.**", "Donec fringilla. Donec feugiat metus sit amet ante."); AddListViewItem(listView, "Josephine Bean", "*****@*****.**", "arcu. Vestibulum ut eros non enim"); AddListViewItem(listView, "Meredith Hooper", "*****@*****.**", "non ante bibendum ullamcorper."); AddListViewItem(listView, "Malcolm Richards", "*****@*****.**", "vitae odio sagittis semper. Nam"); AddListViewItem(listView, "Mary Alvarado", "*****@*****.**", "mollis. Duis sit amet diam eu dolor egestas rhoncus."); AddListViewItem(listView, "Yoshi Day", "*****@*****.**", "quis accumsan convallis, ante"); AddListViewItem(listView, "Harper Mejia", "*****@*****.**", "et, eros. Proin ultrices. Duis volutpat nunc sit"); AddListViewItem(listView, "Sophia Bradford", "*****@*****.**", "ipsum porta elit, a feugiat tellus lorem eu"); AddListViewItem(listView, "Nasim Bernard", "*****@*****.**", "scelerisque mollis. Phasellus libero mauris, aliquam eu, accumsan sed, facilisis"); AddListViewItem(listView, "Cameron Camacho", "*****@*****.**", "sem semper erat, in consectetuer"); AddListViewItem(listView, "Erin Coffey", "*****@*****.**", "libero. Proin mi."); AddListViewItem(listView, "Forrest Wells", "*****@*****.**", "aliquet. Proin velit. Sed malesuada"); AddListViewItem(listView, "Kadeem Phillips", "*****@*****.**", "Proin velit. Sed"); AddListViewItem(listView, "Walter Lane", "*****@*****.**", "Quisque tincidunt pede ac urna. Ut tincidunt vehicula risus. Nulla"); AddListViewItem(listView, "Hannah Strickland", "*****@*****.**", "tellus, imperdiet non, vestibulum nec, euismod in, dolor."); AddListViewItem(listView, "Beck Farmer", "*****@*****.**", "Nullam enim. Sed nulla ante, iaculis nec,"); AddListViewItem(listView, "Renee Alvarez", "*****@*****.**", "Nam ligula elit, pretium et,"); AddListViewItem(listView, "Ulric Harvey", "*****@*****.**", "ac urna. Ut tincidunt vehicula risus. Nulla"); AddListViewItem(listView, "Nelle Ewing", "*****@*****.**", "nibh. Quisque nonummy ipsum non"); AddListViewItem(listView, "Kessie Vega", "*****@*****.**", "tempor arcu. Vestibulum ut eros non enim commodo"); AddListViewItem(listView, "Hyacinth Tucker", "*****@*****.**", "convallis est, vitae sodales nisi magna"); AddListViewItem(listView, "Thomas Ashley", "*****@*****.**", "eu dolor egestas rhoncus. Proin nisl sem, consequat nec,"); AddListViewItem(listView, "Erasmus Alexander", "*****@*****.**", "ullamcorper magna. Sed eu eros. Nam"); AddListViewItem(listView, "Melinda Dillon", "*****@*****.**", "elementum sem, vitae"); AddListViewItem(listView, "Leilani Richardson", "*****@*****.**", "ante ipsum primis"); AddListViewItem(listView, "Armand Hood", "*****@*****.**", "sed tortor. Integer aliquam adipiscing lacus. Ut nec urna"); AddListViewItem(listView, "Adrienne Oliver", "*****@*****.**", "Phasellus dolor elit, pellentesque a, facilisis non, bibendum sed, est."); AddListViewItem(listView, "May Willis", "*****@*****.**", "ultricies ligula. Nullam enim. Sed nulla ante, iaculis nec, eleifend"); AddListViewItem(listView, "Marsden Buck", "*****@*****.**", "Quisque porttitor eros nec tellus. Nunc lectus pede, ultrices"); AddListViewItem(listView, "Lee Buckley", "*****@*****.**", "ac mattis velit justo nec"); AddListViewItem(listView, "Linda Santana", "*****@*****.**", "non nisi. Aenean eget metus. In"); AddListViewItem(listView, "Britanni Higgins", "*****@*****.**", "nulla. Donec non justo. Proin non massa non"); AddListViewItem(listView, "Ocean Powers", "*****@*****.**", "ridiculus mus. Proin vel"); AddListViewItem(listView, "Sara Moran", "*****@*****.**", "Curabitur consequat, lectus sit"); AddListViewItem(listView, "Dean Singleton", "*****@*****.**", "Duis cursus, diam at pretium aliquet, metus urna convallis"); AddListViewItem(listView, "Miranda Bolton", "*****@*****.**", "justo. Praesent luctus. Curabitur"); AddListViewItem(listView, "Louis Ross", "*****@*****.**", "orci. Donec nibh. Quisque nonummy ipsum"); AddListViewItem(listView, "Cedric Harrison", "*****@*****.**", "lectus rutrum urna,"); AddListViewItem(listView, "Remedios Tyler", "*****@*****.**", "Fusce mollis. Duis"); AddListViewItem(listView, "Ori Bird", "*****@*****.**", "enim. Etiam imperdiet dictum magna. Ut tincidunt orci quis lectus."); } listView.ResumeLayout(); } } }
private void AddTestData() { if (this.ListView != null) { this.ListView.SuspendLayout(); { ColumnHeader NameColumn = new ColumnHeader(); NameColumn.Text = "Name"; this.ListView.Columns.Add(NameColumn); ColumnHeader DescriptionColumn = new ColumnHeader(); DescriptionColumn.Text = "Description"; this.ListView.Columns.Add(DescriptionColumn); ColumnHeader EffectsColumn = new ColumnHeader(); EffectsColumn.Text = "Effects"; this.ListView.Columns.Add(EffectsColumn); ColumnHeader PriceColumn = new ColumnHeader(); PriceColumn.Text = "Price"; this.ListView.Columns.Add(PriceColumn); this.columnWidthStates = new int[this.columnCount]; this.ListView.Items.Add(new ListViewItem(new string[] { "Gladius", "Sword of ancient Rome.", "ATK +3" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Scimitar", "Single edged curved sword", "ATK +5" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Cutlass", "Sword of the English Navy", "ATK +7" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Saber", "Light cavalry sword", "ATK +9" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Falchion", "Norman curved sword", "ATK +10" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Broadsword (Katzbalger)", "Simple mercenary's sword", "ATK +12" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Bekatowa (Bakatowa)", "Plain, easy-to-use war sword", "ATK +14" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Damascus Sword", "Fine Sword Honed To Razor-Edge", "ATK +17" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Hunter Sword (Jagdplaute)", "Ivory handled hunting sword Sword", "ATK +20, DEF -1" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Bastard Sword", "Standard sword", "ATK +20" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Talwar", "Curved Indian sword", "ATK +22" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Sword of Hador (Sword of Helge)", "House of Hador heirloom", "ATK +24" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Luminus (Orcrist)", "Sword forged by elves", "ATK +26" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Harper", "The sword named Harper", "ATK +28" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Gram (Famous Sword Gram)", "The sword named Gram", "ATK +30" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Dark Blade (Glamdring)", "Sword forged by elves", "ATK +35, DEF +2" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Alucart Sword", "Resembles family sword", "ATK +2" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Tyrfing (Tyrfingr)", "Cursed dark sword Sword", "ATK -30" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Mormegil (Holy Buster)", "Black sword - strong vs. holy", "ATK +25" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Thunderbrand (Thunder Sword of Indra)", "Lightning sword of Indra", "ATK +25" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Icebrand (Ice Sword of Rahab)", "Ice sword of Mim", "ATK +25" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Firebrand (Fire Sword of Agni)", "Fire sword of Oberon", "ATK +25" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Holy Sword", "Cross hilt - strong vs. undead", "ATK +26" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Terminus Est (Hrunting)", "Poisoned executioner's sword", "ATK +32, DEF +2" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Gurthang (Dainslef)", "Gets stronger when bloodied", "ATK +25, DEF +1" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Marsil (Leavatain)", "Powerful sword of flame", "ATK +33, DEF +1" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Mourneblade", "Feeds upon enemy's souls", "ATK +36, DEF +1" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Mablung Sword (Lemuria Sword)", "Spirit sword - improves DEF", "ATK +39, DEF +2" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Alucard Sword", "Mother's family heirloom", "ATK +42" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Badelaire (Scimitar of Barzai)", "Power increases with game play", "ATK + Game Time (in hours)" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Sword Familiar", "Sentient sword familiar", "ATK + Level of Sword (50 through 99)" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Vorpal Blade", "Slices cleanly through enemies", "ATK +25" })); this.ListView.Items.Add(new ListViewItem(new string[] { "Crissaegrim (Valmanway)", "Countless blades dice enemy", "ATK +36" })); // Add some random prices. foreach (ListViewItem item in this.ListView.Items) { float price = Random.Range(1, 1000); price *= 100; string text = "$" + price; item.SubItems.Add(text); } } this.ListView.ResumeLayout(); } }
public object Clone() { ColumnHeader clone = new ColumnHeader(); clone.ListView = this.ListView; clone.Name = this.Name; clone.Tag = this.Tag; clone.Text = this.Text; clone.Width = this.Width; return clone; }