• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

TEdit

How to make TEdit but descends from TGraphicControl.
0
joely
Asked:
joely
  • 3
  • 2
1 Solution
 
scrapdogCommented:
For what purpose?
0
 
sassas081597Commented:
TGraphicControl cannot catch the events as TWinControls can. However you can create a TLabel which looks like TEdit and use the Form's events to change the label. The only problem is that you cannot have the label focused - so your control must be alone on the form to be shure that the form sends correct commands:
procedure MyForm.OnKeyPress(...)
begin
   grLabel.Caption:=grLabel.Caption+Key;
end;
If you are interested in a TLabel that looks like TEdit - give a comment and I'll send you the WWW-Page where it can be found.
0
 
joelyAuthor Commented:
I just want this component looks transparent.
Do you have any idea ?

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
sassas081597Commented:
What do you mean for transparent?
This is a TGraphicControl - you either draw something or set the transparent property to TRUE and write down only the text (however you can draw borders too). So please explain what would you like to have more precizely.

SASSAS
0
 
joelyAuthor Commented:
I want the descends from TGraphicControl can receive input like TEdit. So if I put TImage as a background, I can see the background through this component. TEdit can't handle this because TEdit is a descends from TWinControl.
0
 
sassas081597Commented:
Another time, the TGraphicControl cannot be in Focuse - so you should have another component to receive focuse and to send some message to TGraphicControl. The best way is to use TForm for that purpose as shown in the answer. However you can use other controls which can receive focus.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now