suitable widget (which holds the focus)

Hi list,

I have a wxPanel containing a variable number of other custom owner-drawn wxPanels, and a scrollbar which manages these custom wxPanels.

Within a certain context, a crash occurs. I notice that if I add to the main panel a wxButton, as large as the main panel, the crash does not occur anymore.

Since I'm tired of chasing the bug I would try to fix this by adding to my main panel an invisible widget which may hold however the focus on itself, like a wxButton.

My attempts to do this using a wxButton or wxBitmapButton failed. I.e. the wxButton can't hold the focus if it's invisible, and a transparent wxBitmapButton still draws the dummy background of the main panel (when the main panel loses the focus), this way over-drawing the other custom owner-drawn wxPanels.

Is there any other widget (which holds the focus) I could use?

Thank you,

Cristina.