Groups | Blog | Home
all groups > vb.net controls > october 2004 >

vb.net controls : Problem using a custom control


Richard L Rosenheim
10/25/2004 6:04:43 PM
Okay, I haven't hit it problem before. I'm writing a program, and as part
of the solution, I've created an user control. I dragged some labels,
progress bars and a button onto the control's form. No code yet. If the
control hasn't be placed on the program's form, I'm able to compile the
project. The control shows up in the User Control tab of the toolbar. When
I drag the control to the program's, it paints correctly. But, if I attempt
to compile the project, I get the following error message (twice):

Type 'MyProgram.MyControl' is not defined

The lines in question is where the form declares the control:

Friend WithEvents MyControl1 As MyProgram.MyControl

and when it's instantiated in the InitializeComponent routine:

Me.Control1 = New MyProgram.MyControl

Anyone have any suggestion? I've created/used custom controls before, but
never encountered this issue...

TIA,

Richard Rosenheim

Richard L Rosenheim
10/25/2004 7:13:22 PM
I found a solution. I moved the control to its own project within the
solution and that resolved the issue.

Richard



[quoted text, click to view]

AddThis Social Bookmark Button