Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-25-2004, 11:48 PM
angelo.fischetti angelo.fischetti is offline
Junior Member
 
Join Date: Apr 2003
Posts: 29
Default DBButton in DBCtrlGrid

I have realized a DbButton (show dataset content in the caption) and would like to insert it in a DBCtrlGrid but I from a mistake. How can I do?

tnx in advance
Reply With Quote
  #2  
Old 01-26-2004, 06:31 PM
HTML HTML is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,977
Default RE: DBButton in DBCtrlGrid

Hi :-)

For the TDBCtrlGrid to accept a component it must include the csReplicatable flag for the ControlStyle, meaning "The control can be replicated by the TDBCtrlGrid."

Info from:
http://community.borland.com/article/0,1410,20569,00.html


---------------------------------------------------------

The TDBCtrlGrid accepts panels so if you like you can use a TPanel as a button. You can then place either a TDBText or TDBEdit on the Panel to show the field contents. If you don't have a TDBText component use a TDBEdit with BorderStyle set to bsSingle and set ParentColor to true.


Example:

procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Panel1.BevelInner := bvLowered;
end;

procedure TForm1.Panel1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Panel1.BevelInner := bvRaised;
end;

procedure TForm1.Panel1Click(Sender: TObject);
begin
ShowMessage(Table1.FieldByName('Some Field').AsString);
end;

The only thing left is to assign(pick from the list) the same OnMouseDown, OnMouseUp and OnClick events to the DBEdit or DBText through the object inspector.

Hope this helps.
Reply With Quote
  #3  
Old 01-26-2004, 10:34 PM
angelo.fischetti angelo.fischetti is offline
Junior Member
 
Join Date: Apr 2003
Posts: 29
Default RE: DBButton in DBCtrlGrid

problem solved
tnx
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:18 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.