Custom Controls Disappear

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I’m new to .NET CF. I follow the sample in the article a
http://msdn.microsoft.com/library/d...en-us/dnnetcomp/html/customctrlscompactfx.asp to create my own custom controls with design and runtime versions. I compile them with no problem (I get “defined in multiple places†warnings). I copy the DLLs to the CF directories, add the design version to the IDE Toolbox. When I click and drag it on my test form, nothing happens. What am I doing wrong
Any help would be greatly appreciated

Haobi
 
I'm not sure, but on the first page of ur link the following is stated :
If you implement a control form deriving from System.Windows.Control and
then attempt to add this control to the Toolbox of a Smart Device Extension
project, you will find that the tool itself is grayed out and that it has no
design experience. This is because the base control class is not marked with
any designer attributes in the .NET Compact Framework. To provide a design
experience you must compile an alternate version of your assembly which
links to a different version of the .NET Compact Framework libraries that
are only intended to be referenced at design time

is that it ???


Haobin said:
Hi,
I'm new to .NET CF. I follow the sample in the article at
http://msdn.microsoft.com/library/d...en-us/dnnetcomp/html/customctrlscompactfx.asp
to create my own custom controls with design and runtime versions. I compile
them with no problem (I get "defined in multiple places" warnings). I copy
the DLLs to the CF directories, add the design version to the IDE Toolbox.
When I click and drag it on my test form, nothing happens. What am I doing
wrong?
 
Well, i'm not sure this applys, but if u read further on on the same
document it tells ya u need to make at least 2 projects ; one for the design
assembly and one for the runtime assembly... after that u get a whole
tutorial on how to do that...
good luck with it...

Haobin said:
Hi,
Thanks for your reply.
Yes. I creat a control deriving from System.Windows.Control. I have a
design version of it and its name in the Toolbox is not grayed out. The
problem is when I try to place it onto a test form, nothing happens.
 
Are there and #if's in the designer code? If so, you'll need to define the
constant so the compiler sees that code.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Haobin said:
Hi,
Thanks.
Now I try to make same control as the sample in the article. I make two
projects: SimpleChart and SimpleChartDesigner. I copy the code to my
projects then buid the Solustions. I get SimpleChart.DLL and
SimpleChartDesigner.DLL. I get same problem as before. Then I ty to build
the DLLs from downloaded project. They work. I compare the DLL files. Two
SimpleChart.DLL files have same size. But the size of
SimpleChartDesigner.DLL generated by my project is 20.48K. The other one is
24.576k. What is wrong in my project?
 
Thanks, Chris
Yes. I define the conditional compilation constant

Haobi

----- Chris Tacke, eMVP wrote: ----

Are there and #if's in the designer code? If so, you'll need to define th
constant so the compiler sees that code

--
Chris Tacke, eMV
Co-Founder and Advisory Board Membe
www.OpenNETCF.or
--
Windows CE Product Manage
Applied Data System
www.applieddata.ne


Haobin said:
Hi
Thanks
Now I try to make same control as the sample in the article. I make tw
projects: SimpleChart and SimpleChartDesigner. I copy the code to m
projects then buid the Solustions. I get SimpleChart.DLL an
SimpleChartDesigner.DLL. I get same problem as before. Then I ty to buil
the DLLs from downloaded project. They work. I compare the DLL files. Tw
SimpleChart.DLL files have same size. But the size o
SimpleChartDesigner.DLL generated by my project is 20.48K. The other one i
24.576k. What is wrong in my project
 
I'm having exactly the same problem you're having. Could you explain what you meant by "clean up the references in my test solution"

I tried removing the BasicChart reference that is added to my project when I add that designer DLL to the toolbox and try to add it to my form. And I re-added it to the toolbox, but it still won't add to my form

Dan
 
Would you mind zipping your runtime, design time, and test projects that you got working correctly? Or send them to me at (e-mail address removed)? If I can't get there myself, I could maybe use your working copy as a template to create new controls

Dan
 
Back
Top