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 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 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 4 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
- Bikin angka pada edit text yang ada titik/komanya
by or4n3 in Tip n Trik Pemrograman more 16 years ago - halaman dinamis fastreport????
by bintanghtm in Reporting more 15 years ago - Yahoo! Messenger
by J4ckR1pp3r in Tip n Trik Pemrograman more 15 years ago - about delphi
by bogem in Enginering more 17 years ago - [ASK] Memperpendek Coding
by lord_kimm in Tip n Trik Pemrograman more 18 years ago - Program Akses Flash Disk
by delphi1st in Tip n Trik Pemrograman more 18 years ago - Form Multi
by khairulfahmi in Tip n Trik Pemrograman more 16 years ago - Aplikasi nutup secara otomatis
by fatahjunaidi in Hal umum tentang Pascal Indonesia more 19 years ago - Perulangaan Timer
by xproof in Tip n Trik Pemrograman more 14 years ago - Mas - Mas tolongin ya....
by wiar in Hal umum tentang Pascal Indonesia more 16 years ago