private void Populate(string query) { cBroadheadTools tmpTools = new cBroadheadTools(); List <cBroadheads> tmpList = tmpTools.GetBroadheads(query); for (int i = 0; i < tmpList.Count; i++) { listBroadheads.Items.Add(tmpList[i].TipID + ":" + tmpList[i].Manufacturer + " " + tmpList[i].TipName + " " + tmpList[i].Grains + "gr"); } lblCount.Text = tmpList.Count.ToString() + " Broadheads filtered."; }
private void listBroadheads_SelectedIndexChanged(object sender, EventArgs e) { string tmpStr = ""; bool bTemp = false; for (int i = 0; i < listBroadheads.Text.Length; i++) { if (listBroadheads.Text[i].ToString() == ":") { bTemp = true; } if (!bTemp) { tmpStr += listBroadheads.Text[i]; } } cBroadheadTools tmpTools = new cBroadheadTools(); cBroadheads tmpTip = tmpTools.FindBroadhead(tmpStr); lblManufacturer.Text = tmpTip.Manufacturer; lblBladeCount.Text = tmpTip.BladeCount.ToString(); lblCuttingDiameter.Text = tmpTip.CuttingDiameter.ToString() + "\""; lblGrains.Text = tmpTip.Grains.ToString() + "gr"; lblName.Text = tmpTip.TipName; if (tmpTip.Type == "f") { lblType.Text = "Fixed Blade"; } else if (tmpTip.Type == "m") { lblType.Text = "Mechanical Blade"; } else { lblType.Text = "Small Game"; } }