Backcolor of textfields disappear

I am really helpless at the moment.
I have a window in my application, where 4 Textfields are inside of a Groupbox.

To fill in the needed values I change to another window, which I open modal, choose there a row, fill in the values and close the modal window.

Evereything is to my satisfaction, except these four fields loose their backcolor. But if I go over them with the mousepointer the color returns.

After choosing two items I have to change to another window where I choose the rest.
Stopping after the first window lets the backcolors, as they are, but after the last window, they are gone.

As I can choose the items with mouse (cellclick) or by keydown (first arrow down and enter at the right row) I tried now the keyboard method and there the colors stay.

So it has something to do with cellclick

Has anybody got a clue, why such things can happen?
A solution?
I tried with refresh and I changed the backcolor afterwards … no idea!

And it has something to do with the self.close in the cellclick-wvwnt, because, when I remove it and close the window with another close-button, evereything is ok again.

[quote=189164:@Robert Blazek]I am really helpless at the moment.
I have a window in my application, where 4 Textfields are inside of a Groupbox.

To fill in the needed values I change to another window, which I open modal, choose there a row, fill in the values and close the modal window.

Evereything is to my satisfaction, except these four fields loose their backcolor. But if I go over them with the mousepointer the color returns.

After choosing two items I have to change to another window where I choose the rest.
Stopping after the first window lets the backcolors, as they are, but after the last window, they are gone.

As I can choose the items with mouse (cellclick) or by keydown (first arrow down and enter at the right row) I tried now the keyboard method and there the colors stay.

So it has something to do with cellclick

Has anybody got a clue, why such things can happen?
A solution?
I tried with refresh and I changed the backcolor afterwards … no idea!

And it has something to do with the self.close in the cellclick-wvwnt, because, when I remove it and close the window with another close-button, evereything is ok again.[/quote]

I just tried to create a project corresponding to your description, it does not exhibit any loss of color. Would it be possible for you to post your project, or a simplified version that shows the bug ?

So did I, I made a simple project and everything works fine.

To Post the project?

It is a 10 MB Program and it needs the database to work. And it would be difficult enough, to explain it to somebody, sitting next to me (37 windows at the moment). I don’t think it would be a good idea.

Thanks for the offer.

If I find a solution, I’ll post it. I only thought, maybe somebody has an idea.

37 windows open? You’re probably running out of video ram.

Do the textfields lose their color as soon as the modal window is displayed, or only after you are finished entering data ?

I found the solution now:

self.close Buchmask.GrpKurz.Invalidate(true) Buchmask.LBelegNr.Invalidate(true) Buchmask.GrpLang.Invalidate(true) Buchmask.FixText.Invalidate(true)

After the self.close I refresh every textfield with the invalidate-command.

To answer your question: it is funny, some of the fields loose the color earlier, other later …

But to redraw them from scratch helped

Peter Job, I never said they are opened. They are in the project. But opened maximum 3 windows at the same time.

[quote=189182:@Robert Blazek]I found the solution now:

self.close Buchmask.GrpKurz.Invalidate(true) Buchmask.LBelegNr.Invalidate(true) Buchmask.GrpLang.Invalidate(true) Buchmask.FixText.Invalidate(true)

After the self.close I refresh every textfield with the invalidate-command.

To answer your question: it is funny, some of the fields loose the color earlier, other later …

But to redraw them from scratch helped[/quote]

Peter may be on to something. You may have a memory leak or a reentry somewhere. The invalidate may just be a patch on a deeper issue. Such erratic things are often related. Have a look at Project/Profile code for any suspicious long execution time. And look in Task Manager to see how much resources the app consumes. Often, when an app gobbles 30% CPU or more, it indicates some sort of leak you want to track before your app goes down.

Thanks for this suggestion. But for the moment I do have 5% of CPU and maximum 30 MB of memory