Arsip: [ask] Button dalam DBgrid

more 13 years ago
kepiss
Para master adakah yang bisa membantu saya...
memasukan Tbutton dalam DB grid...
pernah nyoba...dapet code di internet..tapi g bisa...
// pembutan unit
unit GambarDBgrid;
interface
uses windows,Messages,Sysutils,Classes,Graphics,
Controls,Forms,Grids,Dbgrids;
Type
TGambarDBgrid = Class(TDbgrid);
private
FRowHeight:integer;
Protected
Procedure
SetRowHeight(Value:integer);
Public
Function CellRect(Acol,Arow :LongInt):Trect;ReintRoduce;
property Row;
Property Col;
Published
Property RowHieght:integer
Read FRowHieght write SetRowHieght;
end;
Procedure Register;
implementation
uses DB;
Function TGambarDBgrid.CellRect(Acol,Arow:Longint):Trect;
begin
result:=inherited CellRect(Acol,Arow);
end;
Procedure TGambarDBgrid.setRowHieght(Value:integer);
begin
if FRowHieght <> value then begin
FRowHieght :=Value;
DefaultRowHieght :=FRowHieght;
if self.datalink.active then begin
Perform(WM_SIZE,0,0);
end;
end;
end;
procedure Register;
begin
RegisterComponents('Custom',[TGambarDBGrid]);
end;
//---------------------------Menggunakan unitnya
procedure TFgrid.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
Datarect:Trect;
Begin
// Place the button in the first column.
If (Column.Index = 0) Then Begin
With ButtonDBGrid1 Do Begin
DataRect := CellRect(Column.Index,Row);
End;
// Assign the button's parent to the grid.
If SpeedButton1.Parent <> ButtonDBGrid1 Then
SpeedButton1.Parent := ButtonDBGrid1 ;
// Set the button's coordinates.
// In this case, right justify the button.
If SpeedButton1.Left <> (DataRect.Right - SpeedButton1.Width) Then
SpeedButton1.Left := (DataRect.Right - SpeedButton1.Width) ;
If (SpeedButton1.Top <> DataRect.Top) Then
SpeedButton1.Top := DataRect.Top ;
// Make sure the button's height fits in row.
If (SpeedButton1.Height <> (DataRect.Bottom-DataRect.Top)) Then
SpeedButton1.Height := (DataRect.Bottom-DataRect.Top);
End;
End;
adakah cara lain....selain di atas...hehheh....
more 13 years ago
kepiss
@denmasdanang: :kepiss bisa pakai ehlib, lengkapKetemu lagi denmasdanang....hehe. ehlib....itu komponent ya mas???

more 13 years ago
denmasdanang
ok.
kalau sudah kasih skrinsut nya dong, pakai ehlib yang mas maksud seperti apa?
:D
more ...
- Pages:
- 1
reply |
Report Obsolete
AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now:
https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- insert multiselect record ke tabel
by riagil in MySQL more 14 years ago - Modify Delphi Standard Component
by delphi_warrior in Form Enhancement & Graphical Controls more 17 years ago - Send Mail menggunakan Gmail. Error : Could not load SSL lib
by nopex in Tip n Trik Pemrograman more 16 years ago - Konversi citra ke angka biner di delphi
by em052007 in Enginering more 17 years ago - Input di dbGrid
by ayocool in Hal umum tentang Pascal Indonesia more 19 years ago - Auto increment
by umarbakri in MsSQL more 18 years ago - Mengambil Huruf Arab Dan mengermbalikannya Ke Edit Text..??
by juan81 in Hal umum tentang Pascal Indonesia more 16 years ago - [ASK]procedur pencarian data di data grid
by Iansx in Tip n Trik Pemrograman more 18 years ago - ModifySQL u/ data yg sama di MySQL 5.0.45 bermasalah!
by bugan in MySQL more 17 years ago - Hidden or Visible Caption Title !
by diko_male in Network, Files, I/O & System more 16 years ago