private void lbRankResult_SelectedIndexChanged(object sender, EventArgs e) { if (lbRankResult.SelectedIndex >= 0 && lbRankResult.SelectedIndex < SelectedRank.Count) { bDetailView.Enabled = true; bPrintRatio.Enabled = true; CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; if (DetailView != null && DetailView.Visible == true) { DetailView.ForTrace.Clear(); DetailView.UpdateData(MakeExchange()); } if (RatioView != null && RatioView.Visible == true) { RatioView.UpdateData(); } } }
private void bPrintRatio_Click(object sender, EventArgs e) { if (tcMainCtrl.SelectedIndex != -1) { if (RatioView == null) { RatioView = new CookRatioView(this, lbFavResult); if (tcMainCtrl.SelectedIndex == 0) { CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 1) { CookRatioView.SelectedCook = CookData[SearchResult[lbSearchResult.SelectedIndex]]; CookRatioView.DataIndex = SearchResult[lbSearchResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 2) { CookRatioView.SelectedCook = CookData[FavList[lbFavResult.SelectedIndex]]; CookRatioView.DataIndex = FavList[lbFavResult.SelectedIndex]; } RatioView.UpdateData(); RatioView.Activate(); } else { if (RatioView.Visible == true) { RatioView.Visible = false; } else { if (tcMainCtrl.SelectedIndex == 0) { CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 1) { CookRatioView.SelectedCook = CookData[SearchResult[lbSearchResult.SelectedIndex]]; CookRatioView.DataIndex = SearchResult[lbSearchResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 2) { CookRatioView.SelectedCook = CookData[FavList[lbFavResult.SelectedIndex]]; CookRatioView.DataIndex = FavList[lbFavResult.SelectedIndex]; } RatioView.UpdateData(); RatioView.Activate(); } } } }
private void bPrintRatio_Click(object sender, EventArgs e) { if (tcMainCtrl.SelectedIndex != -1) { if (RatioView == null) { RatioView = new CookRatioView(this, lbFavResult); if (tcMainCtrl.SelectedIndex == 0) { CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 1) { CookRatioView.SelectedCook = CookData[SearchResult[lbSearchResult.SelectedIndex]]; CookRatioView.DataIndex = SearchResult[lbSearchResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 2) { CookRatioView.SelectedCook = CookData[FavList[lbFavResult.SelectedIndex]]; CookRatioView.DataIndex = FavList[lbFavResult.SelectedIndex]; } RatioView.UpdateData(); RatioView.Activate(); } else { if (RatioView.Visible == true) RatioView.Visible = false; else { if (tcMainCtrl.SelectedIndex == 0) { CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 1) { CookRatioView.SelectedCook = CookData[SearchResult[lbSearchResult.SelectedIndex]]; CookRatioView.DataIndex = SearchResult[lbSearchResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 2) { CookRatioView.SelectedCook = CookData[FavList[lbFavResult.SelectedIndex]]; CookRatioView.DataIndex = FavList[lbFavResult.SelectedIndex]; } RatioView.UpdateData(); RatioView.Activate(); } } } }