Solved

DBText component displays below other controls....

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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