PDA

View Full Version : چند نکته



Good Looking
سه شنبه 20 فروردین 1387, 00:33 صبح
با سلام
در این تایپیک قصد دارم تا چند نکته را به دوستان ارائه بدهم:
1:تغییر رنگ کنترلTProgressBar

procedure TForm1.Button1Click(sende:TObject
begin
//set the Background color to teal
progressbar1.Brush.color:=clTeal;
//set bar color to yellow
SenMessage(Proressbar1.Handle,pbm_SETBARCOLOR,0,cl yellow

end


2:راست چین کردن گزینه های کنترل TListBox

procedure TForm1(Sender:TOBject
begin
//pder im objectinspector einstellen
//or set in object inspector
;ListBox1.Style:=lbOwnerDrawFixed
;end
procedure TForm1.ListBox1DrawItem(control:TWinControl:Index: Integer;Rect:TRect;State:TOwnerDrawStat

var
l:integer;
t:string;
begin
with ListBox1 do
begin
Canvas.FillRect(Rect;
t:Items[index;
l:=Rect.Right-Canvas.TextWidth(t -1;
canvas.TextOut(1,Rect.Top,t
end;
end;
procedure TForm1.Button1Click(sender:TObject
begin
ListBox1.Items.Add(edit1.text
end;

ادامه دارد....

kharaee_com
سه شنبه 20 فروردین 1387, 00:58 صبح
ممنون ...
فقط کدها رو لطفاً توی تگ بزار ....
موفق باشی...

hr110
سه شنبه 20 فروردین 1387, 08:20 صبح
موارد مشابه این رو در تاپیک نکات برنامه نویسی دنبال کنید.
متشکرم