Jump to content


Photo

How to?


  • Please log in to reply
2 replies to this topic

#1 Epik

Epik
  • Members
  • 8 posts

Posted 26 May 2008 - 03:59 PM

PLEASE HELP!
Error Line!

CODE


01: procedure TForm1.Button1Click(Sender: TObject);
02: var
03: i: Integer;
04: x: Integer;
05: begin
06: with Query do
07: begin
08: Close;
09: SQL.Clear;
10: SQL.Add('SELECT * FROM EMP');
11: Open;
12: end;
13: x := 0;
14: for i := 0 to NextDBGrid.Columns.Count -1 do
15: begin
16: // ShowMessage(NextDBGrid.Columns[i].Name);
17: if NextDBGrid.Columns[i].ClassType = TNxDBNumberColumn then
18: begin
19: inc(x);
20: TNxDBNumberColumn(FindComponent('NxDBNumberColumn' + IntToStr(x))).SpinButtons := False; // ERROR HERE!!! not good code!! why???
21: end;
22: end;
23: end;


Error line is 20;
why???

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 26 May 2008 - 06:17 PM

Hello,

Maybe is better using next code:

CODE
if NextDBGrid.Columns[i].ClassType = TNxDBNumberColumn then
begin
  TNxDBNumberColumn(NextDBGrid.Columns[i]).SpinButtons := False;
end;

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Epik

Epik
  • Members
  • 8 posts

Posted 26 May 2008 - 06:29 PM

Thanks, u'r code is compile good.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users