Disposing - when?


T

TyBreaker

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.
 
Ad

Advertisements

T

TyBreaker

TyBreaker said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Appbar and Tooltips 1
Appbar and focus issues 1
Dynamic buttons 2
VB2005: Controls not appearing on form 3
Form Layout 3
Floating Menu Bar 6
System Icons? 2
Prompting for an IP address 4

Top