Custom Controls

S

Steve

Hi,

I'm just trying the new functionality of vs2005 to create custom controls.
I've created a new control library with a simple user control that just has
a button on it. I've referenced it from another project but when I drag it
from the toolbox onto a form it just disappears and won't stick to the form.

Am I missing something.

Thanks
Steve.
 
F

Fabien

Hi,

Very strange comportment, check the size of your component. If it is
ok, try to add your component manulally to your Form.
Component myComponent = new Component();
// Put a correct size and correct position
myForm.Controls.add(myComponent)....

BR


Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/


Steve a écrit :
 
S

Steve

Adding it at run time works. It would be nice to use it in design time
though.

Thanks.


Hi,

Very strange comportment, check the size of your component. If it is
ok, try to add your component manulally to your Form.
Component myComponent = new Component();
// Put a correct size and correct position
myForm.Controls.add(myComponent)....

BR


Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/


Steve a écrit :
 
C

Charles Jenkins

Why not post the steps to create your control, along with the control's
main .cs file in a reply to this newsgroup. If someone here can duplicate
the behavior, it would be easier to diagnose.

After you have developed the step-by-step instructions for creating your
control, you might try following them again to create a new example control
for posting. I did that last week when adding a new type of event made a
control quit working; I wanted to post example code here that would be as
brief as possible. To my surprise, the example control worked just fine! (I
still do not know what was different about it.)

So instead of posting a question, I was able to port the full functionality
of my broken control into the new, working one.
 
S

Steve

Your right- I'll try and be more descriptive in the future, although I've
fixed the problem. When I referenced the control library from my
DeviceApplication I was referencing the project and not browsing for the
actual dll(although I don't think there should be any difference!).

Thanks
Steve.
 

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