Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabled for mouse input while hidden

Status
Not open for further replies.

bobbie100

Programmer
Aug 29, 2003
64
GB
I have about 30 controls (various descendants of TGraphicControl) distributed across a form. To overcome limitations in redrawing them as some controls move I have taken control of drawing the entire form via an off-screen bitmap. I was hoping that the controls would still be available to receive mouse inputs by hiding the components (Visible := False) while still leaving them with Enabled := True, but this does not seem to work. In fact, it seems to be worse than that, because in the regions of the form where the controls have been hidden I do not get any Mouse click messages at all. I am only interested in responding to MouseDown and MouseUp events.

I have already tried drawing to a TPanel in front of the form while keeping Visible := True on all the form controls. However every time I change the TPanel image all the underlying controls try and repaint which plays havoc with the update rate redrawing the moving parts of the form image.

Does anybody know a way of doing this that will retain the mouse response across the whole of the client area. It is desirable that I don't have to write separate code for checking whether the mouse is inside the bounds of every control at each click.

Many thanks in advance for reading this,
Bob
 
Apologies, but I was misleading in the original post. I have tried drawing to a TImage in front of the form rather than a TPanel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top