Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. delegate array of controls

delegate array of controls

Scheduled Pinned Locked Moved Database
data-structureshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tiagu
    wrote on last edited by
    #1

    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.

    Richard DeemingR C 2 Replies Last reply
    0
    • T tiagu

      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.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      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

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • T tiagu

        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.

        C Offline
        C Offline
        CHill60
        wrote on last edited by
        #3

        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();

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups