Solved is inaccessible due to its protection level

Posted on 2004-11-20
Last Modified: 2008-02-26

My problem is : is inaccessible due to its protection level.
the source code :

public class Desktop : System.Windows.Forms.UserControl
private System.Windows.Forms.ImageList IconImageList;
protected override void OnPaint( PaintEventArgs pe )
Bitmap IconBitmap = IconImageList.GetBitmap(1);
I cannot mean, beacuse everyibody do it same ?
Question by:wwwbetyar
    LVL 3

    Accepted Solution

    I am not sure why you want to access GetBitmap - if you need the image from within the imageList - here's how you do it

    protected override void OnPaint(PaintEventArgs pe)
        ImageList.ImageCollection images = IconImageList.GetImages();
        foreach(Image img in Images)
            // do your operation with the images - you can also access them using Images[k]
            // you can cast img to Bitmap if needed
            Bitmap iconBmp = (Bitmap)img;
            //do something

    Author Comment

    IconImageList does not contain definition GetImages();

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now