Arsip: [ask] Button dalam DBgrid
more 11 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 11 years ago
kepiss
@denmasdanang: :kepiss bisa pakai ehlib, lengkapKetemu lagi denmasdanang....hehe. ehlib....itu komponent ya mas???
more 11 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 3 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 3 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 11 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 11 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 11 years ago
Random Topic
- [Ask]dbGrid dgn Background image
by kabuki_enemy in Tip n Trik Pemrograman more 15 years ago - License Delphi
by -BeT- in Komersial more 15 years ago - Tanya bikin interface 3D di delphi
by 113050251 in Hal umum tentang Pascal Indonesia more 16 years ago - nomer otomatis
by adit_male_01 in Hal umum tentang Pascal Indonesia more 16 years ago - edit registry (butuh mendadak - skripsi)
by gatotkaca in Tip n Trik Pemrograman more 15 years ago - Buat program untuk menampilkan slide show file ppt
by h4de5 in Tip n Trik Pemrograman more 13 years ago - Bikin Program Anmtrian Bank
by krishy in Tip n Trik Pemrograman more 16 years ago - Last Post tdk tepat
by mas_kofa in Kritik & Saran more 17 years ago - Buka laci cash register dengan Delphi
by wati in Hal umum tentang Pascal Indonesia more 13 years ago - Edit, combo Box dan Array
by priki in Tip n Trik Pemrograman more 17 years ago