Solved

Adding new instance of a custom control

Posted on 2014-03-10
2
267 Views
Last Modified: 2014-03-13
Greetings,

I have created a custom control based on a picturebox. If I drag it from the tool bar it works great. The code for it is below.

If however; on a code page I add private DRpictureBox e3picbox = new DRpictureBox ( );
I get an error of DRpictureBox is a 'namespace' but used as a 'type'

I have added the reference to the DRpicturebox and added a using for it as well.

What am I missing?

Thanks, Ron

namespace DRpictureBox
      {
      public partial class DRpictureBox : PictureBox
            {
            private string ipAddress = "192.168.1.0";
            private int modbusAddress = 90;

            [
                  Category("Addresses"),
                  Description("IP Address")
            ]
            
            
            public string IP
                  {
                  get { return ipAddress; }
                  set { ipAddress = value; Invalidate ( ); }
                  }

            [
                  Category("Addresses"),
                  Description("Modbus Address")
            ]

            public int Modbus
                  {
                  get { return modbusAddress; }
                  set { modbusAddress = value; Invalidate ( ); }
                  }

            public DRpictureBox ( )
                  {
                  }
            }
      }
0
Comment
Question by:rwensley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
SStory earned 500 total points
ID: 39917524
I think you'd need to do
DRpictureBox.DRpictureBox

Or change the namespace to not be the same name.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

630 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