1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165:
| string[,] namenauswahl; FileInfo[] originalnamen; string quelle; int counter=6; string[,,] bilderarryzuordung; Int32 arraygroeße;
public Bildauswahl(string name, string[,] bildernamenarry, string Pfadangabe) { InitializeComponent(); arraygroeße = bildernamenarry.Length/2; string[] tempumwandler = name.Split(';'); namenauswahl = new string[tempumwandler.Length, tempumwandler.Length]; for (int l = 0; l < tempumwandler.Length; l++) { namenauswahl[l, 0] = tempumwandler[l]; namenauswahl[l, 1] = Convert.ToString(l+1); comboBox1.Items.Add(l+1); comboBox2.Items.Add(l+1); comboBox3.Items.Add(l+1); comboBox4.Items.Add(l + 1); comboBox5.Items.Add(l + 1); comboBox6.Items.Add(l + 1); } quelle = Pfadangabe; bilderarryzuordung = new string[arraygroeße, 1, 3]; for (int i = 0; i < arraygroeße; i++) { bilderarryzuordung[i,0,0] = bildernamenarry[i,0]; bilderarryzuordung[i,0,1] = bildernamenarry[i,1]; } bildweiterschalter(0); comboBox1.SelectedIndex = 0; comboBox2.SelectedIndex = 0; comboBox3.SelectedIndex = 0; comboBox4.SelectedIndex = 0; comboBox5.SelectedIndex = 0; comboBox6.SelectedIndex = 0; }
public void bildweiterschalter(int c) { try { for (int i = c; i < arraygroeße; i=i+5) { if (Convert.ToInt32(bilderarryzuordung[i,0,1]) == i+1) { p1.Image = Image.FromFile(quelle + '\\' + bilderarryzuordung[i, 0,0].ToString()); } if (Convert.ToInt32(bilderarryzuordung[i+1,0,1]) == i + 2) { p2.Image = Image.FromFile(quelle + '\\' + bilderarryzuordung[i + 1, 0,0].ToString()); } if (Convert.ToInt32(bilderarryzuordung[i+2,0,1]) == i +3) { p3.Image = Image.FromFile(quelle + '\\' + bilderarryzuordung[i + 2, 0,0].ToString()); } if (Convert.ToInt32(bilderarryzuordung[i+3,0,1]) == i + 4) { p4.Image = Image.FromFile(quelle + '\\' + bilderarryzuordung[i + 3, 0,0].ToString()); } if (Convert.ToInt32(bilderarryzuordung[i+4,0,1]) == i + 5) { p5.Image = Image.FromFile(quelle + '\\' + bilderarryzuordung[i + 4, 0,0].ToString()); } if (Convert.ToInt32(bilderarryzuordung[i+5, 0,1]) == i + 6) { p6.Image = Image.FromFile(quelle + '\\' + bilderarryzuordung[i + 5, 0,0].ToString()); } break; } } catch (Exception) { } }
private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up) { if (counter>=6) { counter = counter - 6; bildweiterschalter(counter); } }
if (e.KeyCode == Keys.Down) { counter = counter + 6; bildweiterschalter(counter); } }
private void comboBox1_TextChanged(object sender, EventArgs e) { string[] dateiformat= bilderarryzuordung[counter, 0,0].Split('.'); if (comboBox1.SelectedItem != null && comboBox1.SelectedIndex > 0) { bilderarryzuordung[counter-6,0,2] = namenauswahl[Convert.ToInt32(comboBox1.SelectedItem)-1, 0].ToString() + "." + dateiformat[dateiformat.Length - 1]; } }
private void comboBox2_TextChanged(object sender, EventArgs e) { string[] dateiformat = bilderarryzuordung[counter, 0,0].Split('.'); if (comboBox2.SelectedItem != null && comboBox2.SelectedIndex > 0) { bilderarryzuordung[counter-5,0,2] = namenauswahl[Convert.ToInt32(comboBox1.SelectedItem) - 1, 0].ToString() + "." + dateiformat[dateiformat.Length - 1]; } }
private void comboBox3_TextChanged(object sender, EventArgs e) { string[] dateiformat = bilderarryzuordung[counter, 0,0].Split('.'); if (comboBox3.SelectedItem != null && comboBox3.SelectedIndex > 0) { bilderarryzuordung[counter-4, 0,2] = namenauswahl[Convert.ToInt32(comboBox1.SelectedItem) - 1, 0].ToString() + "." + dateiformat[dateiformat.Length - 1]; } }
private void comboBox4_TextChanged(object sender, EventArgs e) { string[] dateiformat = bilderarryzuordung[counter, 0,0].Split('.'); if (comboBox4.SelectedItem != null && comboBox4.SelectedIndex > 0) { bilderarryzuordung[counter-3, 0,2] = namenauswahl[Convert.ToInt32(comboBox1.SelectedItem) - 1, 0].ToString() + "." + dateiformat[dateiformat.Length - 1]; } }
private void comboBox5_TextChanged(object sender, EventArgs e) { string[] dateiformat = bilderarryzuordung[counter, 0,0].Split('.'); if (comboBox5.SelectedItem != null && comboBox5.SelectedIndex > 0) { bilderarryzuordung[counter-2, 0,2] = namenauswahl[Convert.ToInt32(comboBox1.SelectedItem) - 1, 0].ToString() + "." + dateiformat[dateiformat.Length - 1]; } }
private void comboBox6_TextChanged(object sender, EventArgs e) { string[] dateiformat = bilderarryzuordung[counter, 0,0].Split('.'); if (comboBox6.SelectedItem != null && comboBox6.SelectedIndex > 0) { bilderarryzuordung[counter-1, 0,2] = namenauswahl[Convert.ToInt32(comboBox1.SelectedItem) - 1, 0].ToString() + "." + dateiformat[dateiformat.Length - 1]; } }
private void Bildauswahl_FormClosing(object sender, FormClosingEventArgs e) { ((Form1)Owner).Namensrueckgabe(bilderarryzuordung); } } } |