Results 1 to 4 of 4

Thread: Passing ImageList between forms

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458

    Passing ImageList between forms

    Hi,
    I have two forms frmMain and frmUsers.
    frmMain has an ImageList, and I fill that list with pics from file when program starts.
    However I need to use the pics from the ImageList on my other form.

    How can I use the ImageList from frmMain in my other form?
    Thanks

    Tomexx.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Passing ImageList between forms

    If you instantiate both frmMain and frmUsers from the same module, they will now be visible to each other. You can then, from frmUsers, access the ImageList like so:

    frmMain.ImageList1.properties[index]

    HTH

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458

    Re: Passing ImageList between forms

    Hi,
    That sounds promising but... I've no idea how to "instanciate both forms from the same module". I'm new to c#
    An example would be helpfull.
    Thanks

    Tomexx.

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Passing ImageList between forms

    This is an example of what he means:
    Code:
    public static void Main()
    {
    	frmMain f1;
    	frmUsers f2;
    	//The rest of your code
    }
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width