arkadaşlar merhaba, string gridde dbgriddeki gibi button ve combobox eklemek istiyorum fakat nereden yapılacağı konusunda bilgim yok yardımcı olursanız sevnirim.
iyi çalışmalar...
string gride dbgriddeki gibi combobox eklemek istiyorum ama
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!
Arşivden !
Kolay Gelsin...
Kod: Tümünü seç
procedure TForm1.FormCreate(Sender: TObject);
begin
{The combobox height is not settable, so we will}
{instead size the grid to fit the combobox!}
StringGrid1.DefaultRowHeight := ComboBox1.Height;
{Hide the combobox}
ComboBox1.Visible := False;
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
{Get the ComboBox selection and place in the grid}
StringGrid1.Cells[StringGrid1.Col,
StringGrid1.Row] :=
ComboBox1.Items[ComboBox1.ItemIndex];
ComboBox1.Visible := False;
StringGrid1.SetFocus;
end;
procedure TForm1.ComboBox1Exit(Sender: TObject);
begin
{Get the ComboBox selection and place in the grid}
StringGrid1.Cells[StringGrid1.Col,
StringGrid1.Row] :=
ComboBox1.Items[ComboBox1.ItemIndex];
ComboBox1.Visible := False;
StringGrid1.SetFocus;
end;
procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
var
R: TRect;
begin
if ((ACol = 3) AND
(ARow <> 0)) then begin
{Size and position the combo box to fit the cell}
R := StringGrid1.CellRect(ACol, ARow);
R.Left := R.Left + StringGrid1.Left;
R.Right := R.Right + StringGrid1.Left;
R.Top := R.Top + StringGrid1.Top;
R.Bottom := R.Bottom + StringGrid1.Top;
ComboBox1.Left := R.Left + 1 ;
ComboBox1.Top := R.Top + 1 ;
ComboBox1.Width := (R.Right + 1) - R.Left;
ComboBox1.Height := (R.Bottom + 1) - R.Top;
{Show the combobox}
ComboBox1.Visible := True;
ComboBox1.SetFocus;
end;
CanSelect := True;
end;
Gazete manşetleri
* DİKKAT :Lütfen forum kurallarını okuyalım ve uyalım...!
* Warez,crack vs. paylaşımı kesinlikle yasaktır.