Results 1 to 4 of 4
  1. #1
    OzeTheDude's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    Brazil
    Posts
    30
    Reputation
    10
    Thanks
    1

    Coding problem (C#)

    I get this little error on my code, can anyone help me fix it?
    Code:
    private void title_list_SelectedIndexChanged(object sender, EventArgs e)
            {
                title_text.Text = title_list.SelectedItem.ToString();
                object obj = ResourceManager.GetObject("93");
                var img = ((System.Drawing.Bitmap)(obj));
                image_title.Image = img;
            }
    Error:
    Code:
    Error	1	An object reference is required for the non-static field, method, or property 'System.Resources.ResourceManager.GetObject(string)'

  2. #2
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    You need to create a ResourceManager Object in order to use its methods, as it is not static.

    Code:
    ResourceManager Manager = new ResourceManager();
    object obj = Manager.GetObject("93");


    CoD Minion from 09/19/2012 to 01/10/2013

  3. #3
    OzeTheDude's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    Brazil
    Posts
    30
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by -InSaNe- View Post
    You need to create a ResourceManager Object in order to use its methods, as it is not static.

    Code:
    ResourceManager Manager = new ResourceManager();
    object obj = Manager.GetObject("93");
    now i get another error

    Error 1 'System.Resources.ResourceManager.ResourceManager( )' is inaccessible due to its protection level

    ???

  4. #4
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    I made that straight up form my head so it was wrong :P

    Right one:
    Code:
    ResourceManager Manager;
    object obj = Manager.GetObject("93");
    PS: You should start learning what those errors mean... Google is there for you.


    CoD Minion from 09/19/2012 to 01/10/2013

Similar Threads

  1. Menu code problem. Cannot open include file: 'Base.h'
    By westomat in forum Combat Arms Help
    Replies: 12
    Last Post: 08-02-2010, 05:34 AM
  2. Code Problem
    By Sydney in forum Combat Arms EU Hack Coding/Source Code
    Replies: 3
    Last Post: 07-28-2010, 08:59 AM
  3. coding problem:help me
    By hunter1118 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 8
    Last Post: 04-20-2010, 08:27 PM
  4. Premium C++ coding problem
    By killerld in forum WarRock - International Hacks
    Replies: 1
    Last Post: 07-24-2009, 07:04 PM
  5. c++ code problems
    By mark.t in forum Programming Tutorial Requests
    Replies: 2
    Last Post: 12-27-2008, 02:20 PM