Components problem

O

odwrotnie

Hi,

am I understanding wrong that "Custom Control" or "Control Class" is for
drawing components from standard .net components?

Why when I am trying to drag and drop sth. on its surface it stays as an
icon?

What am I understandig wrong?

How can I create my own component drawing it from standard components?
 
C

Cor Ligthert [MVP]

Components can put in a toolbox, as Controls can that as well.

Controls are in net windowforms or webform user interface parts (a
windowform itself as well) that inherits from the two control classes.
Visual Studio has made it possible in a lot of way to add those to a
toolbox.

http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.aspx

A component inherit from component, those can as well be put in the toolbox,
you see than the standard symbol for that.

I hope this gives an idea

Cor
 
O

odwrotnie

I hope this gives an idea

Yes it gave. But it is not what i was asking for (sorry for my english).

I am curious how can i edit this class:

using System;
using System.Collections.Generic;
using System.Text;

namespace SGDesigner
{
class StateGraph : System.Windows.Forms.Panel
{
}
}

in graphic editor - so i can add button and move it and resize it and
WYSIWYG ;).
 
C

Cor Ligthert [MVP]

Add the code to it, and than build it as a library project is mostly the
most simple solution.

Right click the Toolbox, and than browse to your dll.

Cor
 
O

odwrotnie

But when I add for example button in Designer mode, VS2005 ads this:

//
// button1
//
this.button1.Location = new System.Drawing.Point(0, 0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;

but this button isnt visible when the application is running :|.

Should I add any additional code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top