The "components" stuff, no. You won't need that. However, you should
managed resources that are internal to your custom control. So the "Dispose"
method *may* be relevant to you. This pattern should pretty much already
"Genifer" <jpierce2@austin.rr.com> wrote in message
news:%23xN$eJFmFHA.3900@TK2MSFTNGP09.phx.gbl...
> Thanks Tim! Very appreciated!
>
> Is any of the following also needed with an authored control vs. a user
> control?
>
> // private System.ComponentModel.IContainer components = null;
>
> // /// <summary>
> // /// Clean up any resources being used.
> // /// </summary>
> // /// <param name="disposing">true if managed resources should be
> disposed; otherwise, false.</param>
> // protected override void Dispose(bool disposing)
> // {
>
>
>
> "Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
> news:et4nXGslFHA.1044@tk2msftngp13.phx.gbl...
> >> I suspect that AutoScaleMode is a property of the user
> >> UserControl class and that the error occurs because I
> >> inherit from the controls class.
> > Yes. I forgot to mention that. This is usually one of the first things
> > that
> > I do after creating a control library project (if I'm not planning on
> > using
> > the UserControl)... refactor the name, change to inherit from Control
(or
> > another class), and just delete (off the top of my head)
> > UserControl1.Designer.cs (you will need to show all files to see this
> > file)
> > since (again, off the top of my head) it only contains the
> > InitializeComponent method, which is usually not used when you're
> > inheriting
> > from Control since this is really more of a designer-related method.
> >
> >> Is this acceptable of should I be using AutoScaleMode
> >> with my non user type custom control?
> > Just delete that line, or the file as I mentioned above. As the compiler
> > indicated, it's not available to you since it's introduced with the
> > ContainerControl class, which the UserControl class inherits from.
> >
> > --
> > Tim Wilson
> > .Net Compact Framework MVP
> >
> > "notu" <jpierce2@austin.rr.com> wrote in message
> > news:OpuWtqrlFHA.708@TK2MSFTNGP09.phx.gbl...
> >> Well that worked better than expected. I had to change my class to a
> > partial
> >> class. The only real error i got was...
> >>
> >>
> >>
> >> Error 1 'My.CustomControls.MyGrid' does not contain a definition for
> >> 'AutoScaleMode'
> >>
> >>
> >>
> >> *MyGrid.Designer.cs has ...
> >>
> >> private void InitializeComponent()
> >>
> >> {
> >>
> >> components = new System.ComponentModel.Container();
> >>
> >> this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
> >>
> >> }
> >>
> >> I suspect that AutoScaleMode is a property of the user UserControl
class
> >> and that the error occurs because I inherit from the controls class.
> >>
> >> I can remark out the autoscalemode line and it compiles.
> >>
> >> Is this acceptable of should I be using AutoScaleMode with my non user
> > type
> >> custom control?
> >>
> >>
> >>
> >> Thanks
> >>
> >> "Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in
> >> message
> >> news:%23VIXzpqlFHA.1412@TK2MSFTNGP09.phx.gbl...
> >> > You have to migrate. I don't think that there are any resources out
> > there
> >> > yet to explain this process. I would just create a new control
library
> >> > project, add your existing code, and compile. If you add an
application
> >> > project to the same solution, then once you compile your control
> > (whether
> >> > it
> >> > inherits from Control or UserControl) it should appear at the top of
> >> > the
> >> > ToolBox. Then just drag and drop. Of course, it may not be this
> > simple...
> >> > it
> >> > really depends on how extensive your custom control is.
> >> >
> >> > --
> >> > Tim Wilson
> >> > .Net Compact Framework MVP
> >> >
> >> > "notu" <jpierce2@austin.rr.com> wrote in message
> >> > news:uLLs2UqlFHA.3816@tk2msftngp13.phx.gbl...
> >> >> The web cast and link show how to create a 'User" type custom
control
> > not
> >> > a
> >> >> custom control that inherits from control class or a specific class
> > like
> >> >> panel. I need to create a non-user type control that can be added to
> > the
> >> >> toolbox. I have done this in VS 2003 the control can be dragged onto
> >> >> forms
> >> >> from the toolbox. So what I need is to know how to get my custom
> > controls
> >> >> that I created in VS 2003 to appear on the toolbox in VS 2005.
> >> >>
> >> >>
> >> >>
> >> >> Any further help would be great.
> >> >>
> >> >>
> >> >>
> >> >> Thanks again.
> >> >>
> >> >>
> >> >>
> >> >> "Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in
> >> >> message
> >> >> news:unfFMXGlFHA.4000@TK2MSFTNGP12.phx.gbl...
> >> >> > There's also an article, done by the same person that did the
> > webcast,
> >> >> > starting at the link below. The article is similar to the webcast
in
> >> > terms
> >> >> > of what is covered.
> >> >> >
http://symbian.sys-con.com/read/113332_1.htm > >> >> >
> >> >> > --
> >> >> > Tim Wilson
> >> >> > .Net Compact Framework MVP
> >> >> >
> >> >> > "Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in
> >> > message
> >> >> > news:e8rO3b8kFHA.1444@TK2MSFTNGP10.phx.gbl...
> >> >> >> There's not a whole lot of information floating around, yet,
about
> > the
> >> >> >> way
> >> >> >> custom controls for devices are built using VS 2005. The short
> > answer
> >> > is
> >> >> >> that you no longer need to build a design-time assembly manually
to
> >> >> > include
> >> >> >> design-time attributes as this is now done using a special
> >> >> >> XML-based
> >> >> >> file.
> >> >> >> One resource that you may want to look into, however, is the
> > "Creating
> >> >> >> Custom Controls for Managed Code with Design Time Support in
Visual
> >> >> >> Studio
> >> >> >> 2005" webcast that was done not too long ago.
> >> >> >>
> >> >> >
> >> >
> >
http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032277944&EventCategory=5&culture=en-US&CountryCode=US > >> >> >>
> >> >> >> --
> >> >> >> Tim Wilson
> >> >> >> .Net Compact Framework MVP
> >> >> >>
> >> >> >> "notu" <jpierce2@austin.rr.com> wrote in message
> >> >> >> news:ekN9z27kFHA.4028@TK2MSFTNGP10.phx.gbl...
> >> >> >> > Hi
> >> >> >> >
> >> >> >> > I have several custom controls developed for VS 2003 that can
be
> >> > added