Control usage question

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

    Control usage question

    1. I have an image list defined in a control
    2. I want to expose trough properties the image list in a manner to be able
    to change it from the container where the control is used.

    How do I do that?

    --
    Horatiu Ripa


  • Vijaye Raji

    #2
    Re: Control usage question

    Use a property

    public ImageList ControlImageLis t
    {
    get
    {
    return imageList;
    }
    }

    ImageList is a class and so a reference type. This means, once you get the
    reference to the image list object, you can modify it however you want.

    -vJ

    "Horatiu Ripa" <unreal@busines sco.us> wrote in message
    news:eRoox1b1DH A.2580@TK2MSFTN GP09.phx.gbl...[color=blue]
    > 1. I have an image list defined in a control
    > 2. I want to expose trough properties the image list in a manner to be[/color]
    able[color=blue]
    > to change it from the container where the control is used.
    >
    > How do I do that?
    >
    > --
    > Horatiu Ripa
    >
    >[/color]


    Comment

    • Horatiu Ripa

      #3
      Re: Control usage question

      Let's be more clear:
      I've made:

      public System.Windows. Forms.ImageList Buttons_Image_l ist
      { get {return buttonsImageLis t;}
      set {buttonsImageLi st = value;} }

      results:
      I've modify the property Buttons_Image_l ist property of my control (in designer, used in the container) to an image list defined there; nothing hapened or on the design or runtime.

      If I put above the property definition:
      [DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content)] to change the default serialization from Visible to content, it initially displays the correct image list at design and runtime, but at the second build (run) , I receive an error:
      "There is already a component named 'myImageList'. Components must have unique names, and names must be case-insensitive. A name also cannot conflict with the name of any component in an inherited class."

      Any ideas????
      --
      Horatiu Ripa
      Software Development Manager
      Business Logic Systems LTD
      21 Victor Babes str., 1st floor, 3400 Cluj-Napoca, Romania
      Phone/Fax: +40 264 590703
      Web: www.businesslogic.co.uk

      This email (email message and any attachments) is strictly confidential, possibly privileged and is intended solely for the person or organization to whom it is addressed. If you are not the intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this email in error, please inform the sender immediately before deleting it. Business Logic Systems Ltd accepts no responsibility for any advice, opinion, conclusion or other information contained in this email or arising from its disclosure.

      "Vijaye Raji" <nospam_vganesh @hotmail.com> wrote in message news:O184JLc1DH A.2184@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Use a property
      >
      > public ImageList ControlImageLis t
      > {
      > get
      > {
      > return imageList;
      > }
      > }
      >
      > ImageList is a class and so a reference type. This means, once you get the
      > reference to the image list object, you can modify it however you want.
      >
      > -vJ
      >
      > "Horatiu Ripa" <unreal@busines sco.us> wrote in message
      > news:eRoox1b1DH A.2580@TK2MSFTN GP09.phx.gbl...[color=green]
      > > 1. I have an image list defined in a control
      > > 2. I want to expose trough properties the image list in a manner to be[/color]
      > able[color=green]
      > > to change it from the container where the control is used.
      > >
      > > How do I do that?
      > >
      > > --
      > > Horatiu Ripa
      > >
      > >[/color]
      >
      >[/color]

      Comment

      • Vijaye Raji

        #4
        Re: Control usage question

        I guess I'd need some code snippets to figure out the problem. Also, where
        did "myImageLis t" come from?

        All properties are serialized by default to code and so, you wouldn't need
        the "DesignerSerial izationVisibili ty" attribute at all.

        -vJ

        "Horatiu Ripa" <unreal@busines sco.us> wrote in message
        news:uME9KPd1DH A.1764@TK2MSFTN GP10.phx.gbl...
        Let's be more clear:
        I've made:

        public System.Windows. Forms.ImageList Buttons_Image_l ist
        { get {return buttonsImageLis t;}
        set {buttonsImageLi st = value;} }

        results:
        I've modify the property Buttons_Image_l ist property of my control (in
        designer, used in the container) to an image list defined there; nothing
        hapened or on the design or runtime.

        If I put above the property definition:
        [DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content)]
        to change the default serialization from Visible to content, it initially
        displays the correct image list at design and runtime, but at the second
        build (run) , I receive an error:
        "There is already a component named 'myImageList'. Components must have
        unique names, and names must be case-insensitive. A name also cannot
        conflict with the name of any component in an inherited class."

        Any ideas????
        --
        Horatiu Ripa
        Software Development Manager
        Business Logic Systems LTD
        21 Victor Babes str., 1st floor, 3400 Cluj-Napoca, Romania
        Phone/Fax: +40 264 590703
        Web: www.businesslogic.co.uk

        This email (email message and any attachments) is strictly confidential,
        possibly privileged and is intended solely for the person or organization to
        whom it is addressed. If you are not the intended recipient, you must not
        copy, distribute or take any action in reliance on it. If you have received
        this email in error, please inform the sender immediately before deleting
        it. Business Logic Systems Ltd accepts no responsibility for any advice,
        opinion, conclusion or other information contained in this email or arising
        from its disclosure.

        "Vijaye Raji" <nospam_vganesh @hotmail.com> wrote in message
        news:O184JLc1DH A.2184@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Use a property
        >
        > public ImageList ControlImageLis t
        > {
        > get
        > {
        > return imageList;
        > }
        > }
        >
        > ImageList is a class and so a reference type. This means, once you get[/color]
        the[color=blue]
        > reference to the image list object, you can modify it however you want.
        >
        > -vJ
        >
        > "Horatiu Ripa" <unreal@busines sco.us> wrote in message
        > news:eRoox1b1DH A.2580@TK2MSFTN GP09.phx.gbl...[color=green]
        > > 1. I have an image list defined in a control
        > > 2. I want to expose trough properties the image list in a manner to be[/color]
        > able[color=green]
        > > to change it from the container where the control is used.
        > >
        > > How do I do that?
        > >
        > > --
        > > Horatiu Ripa
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Horatiu Ripa

          #5
          Re: Control usage question


          myImageList is the ImageList defined in the form where I use the control.
          My knowkedge is that "DesignerSerial izationVisibili ty" default for a public
          property is "view". Anyhow it does not work at all, with or whithout
          DesignerSeriali zationVisibilit y attribute set to view. The only way it works
          is, as I mentioned below, with
          [DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content)]
          but only for the first time.

          I'm suspecting the property designer - code generator to have some bug...

          --
          Horatiu Ripa
          1
          "Vijaye Raji" <nospam_vganesh @hotmail.com> wrote in message
          news:efzIQYg1DH A.3116@TK2MSFTN GP11.phx.gbl...[color=blue]
          > I guess I'd need some code snippets to figure out the problem. Also,[/color]
          where[color=blue]
          > did "myImageLis t" come from?
          >
          > All properties are serialized by default to code and so, you wouldn't need
          > the "DesignerSerial izationVisibili ty" attribute at all.
          >
          > -vJ
          >
          > "Horatiu Ripa" <unreal@busines sco.us> wrote in message
          > news:uME9KPd1DH A.1764@TK2MSFTN GP10.phx.gbl...
          > Let's be more clear:
          > I've made:
          >
          > public System.Windows. Forms.ImageList Buttons_Image_l ist
          > { get {return buttonsImageLis t;}
          > set {buttonsImageLi st = value;} }
          >
          > results:
          > I've modify the property Buttons_Image_l ist property of my control (in
          > designer, used in the container) to an image list defined there; nothing
          > hapened or on the design or runtime.
          >
          > If I put above the property definition:
          > [DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content)]
          > to change the default serialization from Visible to content, it initially
          > displays the correct image list at design and runtime, but at the second
          > build (run) , I receive an error:
          > "There is already a component named 'myImageList'. Components must have
          > unique names, and names must be case-insensitive. A name also cannot
          > conflict with the name of any component in an inherited class."
          >
          > Any ideas????
          > --
          > Horatiu Ripa
          > Software Development Manager
          > Business Logic Systems LTD
          > 21 Victor Babes str., 1st floor, 3400 Cluj-Napoca, Romania
          > Phone/Fax: +40 264 590703
          > Web: www.businesslogic.co.uk
          >
          > This email (email message and any attachments) is strictly confidential,
          > possibly privileged and is intended solely for the person or organization[/color]
          to[color=blue]
          > whom it is addressed. If you are not the intended recipient, you must not
          > copy, distribute or take any action in reliance on it. If you have[/color]
          received[color=blue]
          > this email in error, please inform the sender immediately before deleting
          > it. Business Logic Systems Ltd accepts no responsibility for any advice,
          > opinion, conclusion or other information contained in this email or[/color]
          arising[color=blue]
          > from its disclosure.
          >
          > "Vijaye Raji" <nospam_vganesh @hotmail.com> wrote in message
          > news:O184JLc1DH A.2184@TK2MSFTN GP12.phx.gbl...[color=green]
          > > Use a property
          > >
          > > public ImageList ControlImageLis t
          > > {
          > > get
          > > {
          > > return imageList;
          > > }
          > > }
          > >
          > > ImageList is a class and so a reference type. This means, once you get[/color]
          > the[color=green]
          > > reference to the image list object, you can modify it however you want.
          > >
          > > -vJ
          > >
          > > "Horatiu Ripa" <unreal@busines sco.us> wrote in message
          > > news:eRoox1b1DH A.2580@TK2MSFTN GP09.phx.gbl...[color=darkred]
          > > > 1. I have an image list defined in a control
          > > > 2. I want to expose trough properties the image list in a manner to be[/color]
          > > able[color=darkred]
          > > > to change it from the container where the control is used.
          > > >
          > > > How do I do that?
          > > >
          > > > --
          > > > Horatiu Ripa
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...