Arsip: [ask] Button dalam DBgrid
more 12 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 12 years ago
kepiss
@denmasdanang: :kepiss bisa pakai ehlib, lengkapKetemu lagi denmasdanang....hehe. ehlib....itu komponent ya mas???
more 12 years ago
denmasdanang
ok.
kalau sudah kasih skrinsut nya dong, pakai ehlib yang mas maksud seperti apa?
:D
more ...
- Pages:
- 1
reply |
Report Obsolete
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
- Augmented reality
by LuriDarmawan in Multimedia & Graphic Enhancement more 14 years ago - player mp3 yang bisa crossfade
by simple_code in Multimedia & Graphic Enhancement more 16 years ago - menampilkan indikator/progress pada proses
by shindo in Hal umum tentang Pascal Indonesia more 17 years ago - Private server RO
by adhiet_cool7 in Games more 17 years ago - (OOT) ada yg punya SW buat bikin autorun gak?
by imunk in Form Enhancement & Graphical Controls more 18 years ago - Bagaimana cara hapus data dengan dua tabel menggunakan SQL
by onsir in MySQL more 16 years ago - was: Komponen SMS. lagi o-on lagi
by LuriDarmawan in OOT more 16 years ago - MONITORING & CONTROL LAMPU MENGGUNAKAN DELPHI
by penyihir in Bedah Kasus more 17 years ago - Midas yang aneh....Ada yang tahu jawabannya ?
by EkoIndri in Tip n Trik Pemrograman more 18 years ago - Delphi, Teknologi dan Dunia Persilatan.
by LuriDarmawan in OOT more 16 years ago