TextBox.Text property empty after hiding and showing the control.

A

Alexander

I am building a little unique dialog editor and have derived some new
classes like DButton, DLabel and DTextBox. The user adds these
Controls to a panel which is part of a class Document which is not a
control. The controls in the dialog can be edited with a PropertyGrid.
When the user closes the dialog he edited it was first disposed,
because it was not part of an Control anymore. I changed that by
overriding the Dispose function of the Panel.

All of this works fine, except that Text of DLabel and DTextBox as the
only properties are deleted, when I close and open the dialog again.
All other properties remain the same, so the position, size of the
TextBox and Label and so on. Even own properties which I added to the
controls work fine and are still there. The Button also works
perfectly and the Text property stays the same.

So is the property Text deleted on some event on the Label and the
Textbox? I already tried to find out where it happens, but it seems
none of the events like OnTextChanged are triggered. I did also
override the property Text once to trace if it is called from
somewhere to reset the Text, but it isnt.
Does someone have an idea why and where the Text is deleted?
 
A

Alexander

Already solved...

The GUI elements were controlled by a non Control class and destroyed
if displayed in a dialog, when the dialog was closed. I simply
rempoved the GUI elements from the dialog before closing it.
 

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

Top