private void PrettyListBox_MeasureItem(object sender, MeasureItemEventArgs e) { PrettyListBox self = sender as PrettyListBox; string str = self.Items[e.Index].ToString(); e.ItemWidth = self.Width; e.ItemHeight = (int)e.Graphics.MeasureString(str, self.Font, e.ItemWidth, StringFormat.GenericDefault).Height; }
public Hunt getSelectedHunt() { PrettyListBox huntList = (Tabs[2] as HuntsTab).GetHuntList(); if (huntList.SelectedIndex < 0) { return(null); } return(HuntManager.GetHunt(huntList.SelectedIndex)); }