Solved

DBText component displays below other controls....

Posted on 2004-04-18
4
212 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
my delphi exe application have  problem with windows explorer ! 12 80
Delphi cmd execution 6 56
URL for downloading Google Chrome for Win XP 2 125
Base1 Encode/Decode 3 68
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

862 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now