private void enemy_listview_MouseDoubleClick(object sender, MouseEventArgs e) { if (enemy_listview.SelectedItems.Count == 1) { int index = enemy_listbox.SelectedIndex; EnemyData obj = (enemyListData[index] as EnemyData); addDropItemForm addDropItem = new addDropItemForm(this, obj, ((enemyListData[enemy_listbox.SelectedIndices[0]] as EnemyData).dropData[enemy_listview.SelectedIndices[0]] as EnemyDropItem)); addDropItem.StartPosition = FormStartPosition.Manual; addDropItem.Location = new Point(Location.X + (Width - addDropItem.Width) / 2, Location.Y + (Height - addDropItem.Height) / 2); addDropItem.Owner = this; addDropItem.ShowDialog(); } }
private void enemy_drop_add_button_Click(object sender, EventArgs e) { if (enemy_listbox.SelectedItems.Count == 1) { int index = enemy_listbox.SelectedIndex; EnemyData obj = (enemyListData[index] as EnemyData); addDropItemForm addDropItem = new addDropItemForm(this, obj); addDropItem.StartPosition = FormStartPosition.Manual; addDropItem.Location = new Point(Location.X + (Width - addDropItem.Width) / 2, Location.Y + (Height - addDropItem.Height) / 2); addDropItem.Owner = this; addDropItem.ShowDialog(); } }