Disposing - when?

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

    #1

    Disposing - when?

    If I create a sub-form (like a dialog) and dynamically create buttons on
    it, do I have to also explicitly dispose each button when I close the
    form or does that happen automatically?

    The problem I'm trying to resolve is my tooltips appear on these
    dynamically created buttons and behave properly when the dialog is first
    displayed but if I close the dialog and open it later, tooltips refuse
    to disappear when I click on the button. Was just wondering if perhaps
    the buttons themselves were confusing my tooltip control by being
    re-created each time the form is displayed?
    --
    ______ ___ __
    /_ __/_ __/ _ )_______ ___ _/ /_____ ____
    / / / // / _ / __/ -_) _ `/ '_/ -_) __/
    /_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
    /___/

    There are 10 types of people in this world; those who understand the
    binary numbering system and those who don't.

    There's no place like 127.0.0.1.

    ASCII a silly question, get a silly ANSI.
  • TyBreaker

    #2
    Re: Disposing - when?

    TyBreaker wrote:
    If I create a sub-form (like a dialog) and dynamically create buttons on
    it, do I have to also explicitly dispose each button when I close the
    form or does that happen automatically?
    >
    The problem I'm trying to resolve is my tooltips appear on these
    dynamically created buttons and behave properly when the dialog is first
    displayed but if I close the dialog and open it later, tooltips refuse
    to disappear when I click on the button. Was just wondering if perhaps
    the buttons themselves were confusing my tooltip control by being
    re-created each time the form is displayed?
    OK solved this one - I was using a MouseClick event and I changed this
    to a MouseDown event instead and then the tooltip worked as required.

    --
    ______ ___ __
    /_ __/_ __/ _ )_______ ___ _/ /_____ ____
    / / / // / _ / __/ -_) _ `/ '_/ -_) __/
    /_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
    /___/

    There are 10 types of people in this world; those who understand the
    binary numbering system and those who don't.

    There's no place like 127.0.0.1.

    ASCII a silly question, get a silly ANSI.

    Comment

    Working...