Default icon for window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • UJ

    Default icon for window

    Is there a way to change the default icon for a window to be the application
    icon? It's just that if you create a new window you have to remember to go
    in and set the icon where it would be nice if it defaulted to the
    application icon.

    TIA - Jeff.


  • Marc Gravell

    #2
    Re: Default icon for window

    One way to do this is to declare a base class (: Form) which defines this
    sort of thing; you then inherit your forms from this one, and presto.

    Note that the base form need not be done in the designer, but it shouldn't
    be abstract, and must have a default ctor, otherwise designer support for
    derived forms starts falling over.

    Variants are available, sunch as basing the icon on the type (presumably
    cached in a static dictionary of Icons that is only populated in you Main()
    method).

    Marc

    "UJ" <fred@nowhere.c om> wrote in message
    news:OVDD0WbUGH A.328@TK2MSFTNG P11.phx.gbl...[color=blue]
    > Is there a way to change the default icon for a window to be the
    > application icon? It's just that if you create a new window you have to
    > remember to go in and set the icon where it would be nice if it defaulted
    > to the application icon.
    >
    > TIA - Jeff.
    >
    >[/color]


    Comment

    Working...