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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How can i make a Panelarray ?

How can i make a Panelarray ?

Scheduled Pinned Locked Moved C#
questioncsharpdata-structures
2 Posts 2 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.
  • S Offline
    S Offline
    summercoal
    wrote on last edited by
    #1

    Hi!! Because i need to create about 50 panel with mouse event. how i can create an object array in C#? I tried Panel[] mPanel = new Panel[50] ; it does not work. How can i compete it?? thx thx!!

    J 1 Reply Last reply
    0
    • S summercoal

      Hi!! Because i need to create about 50 panel with mouse event. how i can create an object array in C#? I tried Panel[] mPanel = new Panel[50] ; it does not work. How can i compete it?? thx thx!!

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      That allocates the array. You then need to initialize the array:

      for(int i = 0; i < mPanel.Length; i++)
      {
      mPanel[i] = new Panel();
      }

      That said, I seriously question why you need to create 50 panels; especially during each mouse event. What are you trying to do?

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: How 'bout a little guitar now? The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      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