Solved

DBText component displays below other controls....

Posted on 2004-04-18
4
214 Views
Last Modified: 2010-04-05
Hi there,
I am building a component that is based on TDBtext, the idea is the component will display something like the popup hint feature for buttons etc on my form. That part is working ok however when the component displays it displays underneath all other features on the form.

I have tried right clicking on the component and going control/bring to front but this does not work.

I think this is a general problem that I am not sure how to overcome. The same thing happens if you just drop a label and a button onto the form. The label will be hidden by the button if you place one on top of the other

Does anyone have any ideas how to solve this issue?

Thanks Myles :)
0
Comment
Question by:myleseven2
4 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 165 total points
ID: 10857182
Hi,

I would place TDBText on a TPanel. It can be bring to front.
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10857457

  DBText1.BringToFront;

 
0
 

Author Comment

by:myleseven2
ID: 10863532
Hi Ivanov G I have tried

DBText1.BringToFront;

and it didin't work, did it work for you?

Mokule... I think that lacing it on a panel might be a good option I shall have a go at that and let you know if it works thanks :)

0
 
LVL 1

Expert Comment

by:AngelRider
ID: 10880496
I think the problem stems from the fact that TDBLabel is not a descendant of TWinControl, and therefore doesn't have a window handle. Without a window handle, the control can only exist on the surface of it's parent - it doesn't understand the concept of z-order and cannot float independently above it's parent.

Mokule's idea is a neat solution - another way to do it would be to derive from TDBEdit, and set the control's BorderStyle to bsNone, and it's Color to clBtnFace. Then make it read-only.

You now have a single component that looks exactly like a TDBEdit, but has a window handle - therefore you can move it back and forth in the form's z-order.

Hope that helps.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question