delegate array of controls
-
I am adding up combo boxes to array of combobox and assigning combo boxes to them like this ComboBox[] arrSize = new ComboBox[5]; arrSize[0] = cbSize_00; arrSize[1] = cbSize_01; arrSize[2] = cbSize_02; arrSize[3] = cbSize_03; arrSize[4] = cbSize_04; I would like to know if there is a way to delegate the array as a whole instead of me delegating each combo box manually. Please help. Thanks in advance.
-
I am adding up combo boxes to array of combobox and assigning combo boxes to them like this ComboBox[] arrSize = new ComboBox[5]; arrSize[0] = cbSize_00; arrSize[1] = cbSize_01; arrSize[2] = cbSize_02; arrSize[3] = cbSize_03; arrSize[4] = cbSize_04; I would like to know if there is a way to delegate the array as a whole instead of me delegating each combo box manually. Please help. Thanks in advance.
You've posted this in the wrong forum - this question has nothing to do with databases. What do you mean by "delegate the array"?
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
I am adding up combo boxes to array of combobox and assigning combo boxes to them like this ComboBox[] arrSize = new ComboBox[5]; arrSize[0] = cbSize_00; arrSize[1] = cbSize_01; arrSize[2] = cbSize_02; arrSize[3] = cbSize_03; arrSize[4] = cbSize_04; I would like to know if there is a way to delegate the array as a whole instead of me delegating each combo box manually. Please help. Thanks in advance.
If you had posted this in the correct forum - C# Discussion Boards - CodeProject[^] or even Quick Answers - CodeProject[^] then you would have probably had an answer much earlier. Please take more care in future. You could do it this way
var arrSize = (from object c in Controls where c.GetType() == typeof(ComboBox) select c as ComboBox).ToArray();