![]() |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
problem solved
tnx |
![]() |
| Thread Tools | |
| Display Modes | |
|
|