http://support.microsoft.com/default.aspx?scid=kb;en-us;311317
but once I replace the control initialization statements to initialize
to my subclass, the grid disapears from the designer. I guess I can
live with it since If I want to get it back I can uncomment the original
grid initialization if I want to edit the grid from the designer, and
then change the initialization back to a subclass when I'm done, but
isn't there a better way? I tried making the subclass a control
selectable from the toolbox, but it's greyed out when I add it. I
couldn't find a set of good instructions on how to get that to work.
If anyone has good instructions on how to subclass a DataGrid and make
it a selectable control from the toolbox, or just any other suggestion
how I can solve the problem described above I would greatly appreciate it.
Alex Feldman
--
Tim Wilson
.Net Compact Framework MVP
"Alex Feldman" <alex-f...@hotmail.com> wrote in message
news:tk6Fe.8943$oZ....@newsread2.news.atl.earthlink.net...
All of these examples seem to do a lot of drawing of the control. Do I
have to implement my own OnPaint code, or any other display
functionality? I was thinking of inheriting from the DataGrid control,
so can't I just let the DataGrid do the painting?
Thanks.
Alex
> I was thinking of inheriting from the DataGrid control,
> so can't I just let the DataGrid do the painting?
Yep.
--
Tim Wilson
.Net Compact Framework MVP
"Alex Feldman" <alex-f...@hotmail.com> wrote in message
news:KDcFe.9109$oZ....@newsread2.news.atl.earthlink.net...
I am trying to run the batch file to do the build, and I get the
following errors:
========Batch file=========
vbc /netcf /define:NETCFDESIGNTIME /target:library
/out:design.DataGridPlus.dll DataGridPlus.vb /r:"C:\Program
Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK
\v1.0.5000\Windows CE\Designer\System.CF.Design.dll" /r:"C:\Program
Files\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Windows.Forms.dll" /r:"C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Drawing.dll" /r:System.Windows.Forms.dll
/r:System.Drawing.dll /r:System.dll /r:System.XML.dll /r:
System.Web.Services.dll /r:System.Data.dll
========Batch file=========
Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.
vbc : error BC30249: Project-level conditional compilation constant
'NETCFDESIGN
TIME' is not valid: '=' expected.
C:\[ProgramPath]\DataGridPlus.vb(34) : error BC30284: sub 'OnMouseDown'
cannot be declared 'Overrides' because it does not override a sub in a
base class.
Protected Overrides Sub OnMouseDown(ByVal e As
System.Windows.Forms.MouseEventArgs)
~~~~~~~~~~~
C:\[ProgramPath]\DataGridPlus.vb(34) : warning BC40003: sub
'OnMouseDown' shadows an overloadable member declared in the base class
'DataGrid'. If you want to overload the base method, this method must
be declared 'Overloads'.
Protected Overrides Sub OnMouseDown(ByVal e As
System.Windows.Forms.MouseEventArgs)
~~~~~~~~~~~
C:\Data\Bartech
Software\PocketBartLite\PBLiteSolution\CustomControls\DataGridPl
us.vb(34) : error BC30560: 'MouseEventArgs' is ambiguous in the
namespace 'Syste
m.Windows.Forms'.
Protected Overrides Sub OnMouseDown(ByVal e As
System.Windows.Forms.MouseEventArgs)
(--OTHER ERRORS FOLLOW, BUT THEY'RE THE SAME AS ABOVE)
~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~
What am I doing wrong? I tried doing just an override overload, or just
an overload, but still got errors. The override worked just fine when I
was subclassing within my application. Also, I based the .BAT file on
the C# compiler example, so I modified it the best I can, but I'm not
sure that it's 100% right.
Thanks for the help.
Alex
When you say "restructure your code", do you mean just the custom
control code? If it's just the custom control code that needs to be in
C# while the application using the control can be in VB.NET that's not a
problem for me. Rewriting the application that would use this control
to be in C# however is not an option.
Thanks again!
Alex
Tim Wilson wrote:
> Building a design-time control is currently only supported using the C#
> compiler in version 1.0 of the CF. I believe that the general idea is that
> the VB compiler throws errors/warnings that can't be suppressed during a
> "design-time build", whereas the C# compiler can suppress these
> errors/warnings. The alternative at this point is to not have a design-time
> version of your control, instead create it manually through code, or you'll
> need to restructure your code in the C# language.
>
--
Tim Wilson
.Net Compact Framework MVP
"Alex Feldman" <alex-f...@hotmail.com> wrote in message
news:BduFe.9388$oZ....@newsread2.news.atl.earthlink.net...
Thanks.
Alex4
Tim Wilson wrote:
>>When you say "restructure your code", do you
>>mean just the custom control code?
>
> Yes.
>
>
>>If it's just the custom control code that needs to
>>be in C# while the application using the control can
>>be in VB.NET that's not a problem for me. Rewriting
>>the application that would use this control to be in C#
>>however is not an option.
>
> Only the custom control would need to be rewritten in C#. You can consume
> this control, even through the designer, with a VB.Net project.
>
--
Tim Wilson
.Net Compact Framework MVP
"Alex Feldman" <alex-f...@hotmail.com> wrote in message
news:t5xFe.9451$oZ....@newsread2.news.atl.earthlink.net...
> If it's just the custom control code that needs to
> be in C# while the application using the control can
> be in VB.NET that's not a problem for me. Rewriting
> the application that would use this control to be in C#
> however is not an option.
Only the custom control would need to be rewritten in C#. You can consume
this control, even through the designer, with a VB.Net project.
--
Tim Wilson
.Net Compact Framework MVP
"Alex Feldman" <alex-f...@hotmail.com> wrote in message
news:wuvFe.9419$oZ....@newsread2.news.atl.earthlink.net...
--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com
I've looked at your thread before. I was actually missing the
/r:"C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Windows.Forms.DataGrid.DLL"
line in my .bat file. I just added it and recompiled. The control is
still greyed out :-(
Alex
csc /noconfig /define:NETCFDESIGNTIME /target:library
/out:design.CustomControls.dll AssemblyInfo.cs DataGridPlus.cs
/r:"C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Design.dll" /r:"C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Windows.Forms.dll" /r:"C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Windows.Forms.DataGrid.dll" /r:"C:\Program
Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Drawing.dll" /r:System.Windows.Forms.dll
/r:System.Drawing.dll /r:System.dll /nowarn:1595
copy /y design.CustomControls.dll "C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\Designer"
copy /y bin\debug\CustomControls.dll "C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE"
Then I added the control to the ToolBox by navigating to the design-time
version (design.CustomControls.dll). The control appears in the ToolBox as
it should, I could drag and drop it onto the Form, and the associated
runtime assembly was automatically added as a reference.
--
Tim Wilson
.Net Compact Framework MVP
"Alex Feldman" <alex-f...@hotmail.com> wrote in message
news:D7MFe.17817$aY6....@newsread1.news.atl.earthlink.net...
> Hi Tim,
>
> I think I did all that correctly. I'm attaching my project for the custom
> control to this post. You will find the .bat file in root directory that
> builds the design time dll and then copies the dlls to the necessary
> destinations. I would then try to add the control by selecting the
> design.CustomControls.dll file in the copied location.
> The RuntimeAssemblyAttribute is set in the AssemblyInfo file, as I've seen
> someone do in this forum before.
>
> On a side note, I have this project as part of my solution that also
> includes the project for my application that uses this custom control. I
> really don't think it should matter since the dlls are copied and are
> autonomous from the Visual Studio IDE. Just wanted to mention that.
>
> Thanks for your help.
>
> Alex
>
>
> "Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
> news:%23kvX2ai...@tk2msftngp13.phx.gbl...
csc /noconfig /define:NETCFDESIGNTIME /target:library
/out:design.CustomControls.dll DataGridPlus.cs AssemblyInfo.cs
/r:"C:\Program Files\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Design.dll" /r:"C:\Program Files\Microsoft Visual
Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Windows.Forms.dll" /r:"C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Drawing.dll" /r:"C:\Program Files\Microsoft Visual
Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Designer\System.CF.Windows.Forms.DataGrid.DLL" /r:System.Drawing.dll
/r:System.Windows.Forms.dll /r:System.dll /r:System.XML.dll
/r:System.Data.dll /nowarn:1595
--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com
Alex Feldman wrote:
> I'm attaching the revised project, with the .bat file modified.
> Alex
>
>
> "Alex Feldman" <alex-f...@hotmail.com> wrote in message
> news:ZyMFe.9912$oZ....@newsread2.news.atl.earthlink.net...
Alex
Alex Feldman wrote:
> ALRIGHT!
>
> Got it working. I made a few small changes to the .bat file. I also had a
> reference to the namespace containing the custom control in my application,
> and I removed that as well. After recompiling that time everything
> worked!. I am attaching the project to this email so that if anyone wants
> to use it in the future they have a quick project to start from. I believe
> that many different custom controls can be added to this project and
> compiled with the .bat file (although I haven't tested it out).
>
> Quick question though....what's the easiest way to subsitute my new custom
> grid in place of the existing grids on my form? When I try to substitude
> the declaration and initialization from the standard to my custom one in
> code the control dissapeared from the designer. I can add a new one and
> reconfigure it the way I did the originals, but is there a way to
> substitute?
>
> Thanks for the help Tim,
> Spasibo Sergey.
>
> Alex
>
> "Alex Feldman" <alex-f...@hotmail.com> wrote in message
> news:TMMFe.9913$oZ....@newsread2.news.atl.earthlink.net...
>
>>I'm attaching the revised project, with the .bat file modified.
>>Alex
>>
>>
>>"Alex Feldman" <alex-f...@hotmail.com> wrote in message
>>news:ZyMFe.9912$oZ....@newsread2.news.atl.earthlink.net...
--
Tim Wilson
.Net Compact Framework MVP
"Alex Feldman" <alex-f...@hotmail.com> wrote in message
news:NbNFe.9925$oZ....@newsread2.news.atl.earthlink.net...
> ALRIGHT!
>
> Got it working. I made a few small changes to the .bat file. I also had
a
> reference to the namespace containing the custom control in my
application,
> and I removed that as well. After recompiling that time everything
> worked!. I am attaching the project to this email so that if anyone wants
> to use it in the future they have a quick project to start from. I
believe
> that many different custom controls can be added to this project and
> compiled with the .bat file (although I haven't tested it out).
>
> Quick question though....what's the easiest way to subsitute my new custom
> grid in place of the existing grids on my form? When I try to substitude
> the declaration and initialization from the standard to my custom one in
> code the control dissapeared from the designer. I can add a new one and
> reconfigure it the way I did the originals, but is there a way to
> substitute?
>
> Thanks for the help Tim,
> Spasibo Sergey.
>
> Alex
>
> "Alex Feldman" <alex-f...@hotmail.com> wrote in message
> news:TMMFe.9913$oZ....@newsread2.news.atl.earthlink.net...
> > I'm attaching the revised project, with the .bat file modified.
> > Alex
> >
> >
> > "Alex Feldman" <alex-f...@hotmail.com> wrote in message
> > news:ZyMFe.9912$oZ....@newsread2.news.atl.earthlink.net...
--
Tim Wilson
.Net Compact Framework MVP
"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:%23a8Qq6r...@TK2MSFTNGP12.phx.gbl...