I haven't done this myself, but look into building a custom server control.
These can be added to your toolbox so that you can place them on forms just
like any other control.
"XNoDE" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks Scott,
>
> Sorry for the mistype, I guess I wasn't really sure how to ask for what I
> wanted. Your second post is correct. If for example I would like all of
my
> buttons to have the default values as:
>
> FlatStyle = Flat
> Size = 96,20
>
> etc..
>
> Is there a way I can have these values preset to my liking so that I only
> have to build the form and code? I know it seems a trivial thing, but
it's
> a preference of mine.
>
> If so, how. If I create the new class that you mention, how do I save it
as
> a control so that I can add it to my forms at leisure? I am familiar with
> creating the class files but I've never coded extensions to a control.
>
> Thanks again,
>
> Xnode
> "Scott M." <s-(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > So, I'm reading your post again and realizing that, you don't want to
set
> > default PROPERTIES on the toolbox controls (as you've written), you
> perhaps
> > want to set a default VALUE for some various properties of the toolbox
> > controls. (Sorry for the mis-read)
> >
> > The controls on the toolbox represent base classes in the .NET Framework
> > class libraries, so the short answer is no. However, you could make a
new
> > control that inherits from the standard one, set whatever property
values
> > you want and use that control instead.
> >
> > Public Class MyTextBox
> > Inherits System.Windows.Forms.Textbox
> >
> > Public Sub New()
> > me.Text = "Some default value."
> > End Sub
> > End Class
> >
> > HTH!
> >
> > Scott
> >
> > "XNoDE" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hi all,
> > >
> > > VS.Net 2002.
> > >
> > > Is there a way to set default properties for controls in the Toolbox?
> > >
> > > There a some properties that I implement as standard in my apps and
> would
> > > like to get around setting these same basic things each time a use a
> > > control.
> > >
> > > TIA,
> > >
> > > XNoDE
> > >
> > >
> >
> >
>
>
|