Archive for the 'Delphi' Category

05AraGrid Üzerinde Seçili Kayda Göre Hareket Eden Panel

DBGrid’in OnDrawDataCell olayına aşağıdaki kodu yerleştirdiğiniz takdirde, panel grid üzerinde sabit kalara seçili kayda göre istediğiniz bilgileri görüntüleyeceğiniz bir bilgi penceresi haline gelecektir.

</pre>
<strong style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">procedure Tfrorm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State:TGridDrawState);</strong>
<strong>VAR</strong>
<strong> iAltsinir : Integer;</strong>
<strong> iKonum : Integer;</strong>
<strong> iToplamKonum: Integer;</strong>
<strong>begin</strong>

<strong>iKonum                      := Rect+ 5; // panelın top'ı secılı satırın 5 altına ayarlanıyor</strong>

<strong>iAltSinir                     := screen.height; //nereye kadar hareket edebileceği ayarlanıyor.</strong>
<strong>iToplamKonum      := iKonum + panel.height + 100; / alt zemıne gelındıgını kontrol edıyor.</strong>

<strong>IF iToplamKonum > iAltsinir THEN // egerkı bır satır sonra panel enranın altına kayacaksa</strong>
<strong> iKonum := iKonum - (panel.height -10 ); // top uzerınde oynama yapılıyor.</strong>

<strong>panel.top:= iKonum; // panel konumu yenıden ayarlanıyor.</strong>

<strong>end;</strong>
end.

 


Recent Flickrs

    Blogroll

    Recent Listening