Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: XE8 VCL FOR PC: How to repair the below because of fail to compile.


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Jul 23, 2015 11:29 PM Last Post By: Rudy Velthuis (...
hots wally

Posts: 53
Registered: 6/14/14
XE8 VCL FOR PC: How to repair the below because of fail to compile.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 21, 2015 11:49 PM
procedure TForm8.ComboBox1Change(Sender: TObject);
begin
if combobox1.ItemIndex = 0 then form2.sg1.DrawingStyle.gdsClassic
else if combobox1.ItemIndex = 1 then form2.sg1.DrawingStyle.gdsGradient
else if combobox1.ItemIndex = 2 then form2.sg1.DrawingStyle.gdsThemed;
form2.sg1.UpdateControlState;
end;
Robert Triest

Posts: 687
Registered: 3/24/05
Re: XE8 VCL FOR PC: How to repair the below because of fail to compile.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 22, 2015 12:44 AM   in response to: hots wally in response to: hots wally
What is the (error) message that the compiler is giving you?
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: XE8 VCL FOR PC: How to repair the below because of fail to compile.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 22, 2015 1:15 AM   in response to: hots wally in response to: hots wally
hots wally wrote:

procedure TForm8.ComboBox1Change(Sender: TObject);
begin
if combobox1.ItemIndex = 0 then form2.sg1.DrawingStyle.gdsClassic
else if combobox1.ItemIndex = 1 then
form2.sg1.DrawingStyle.gdsGradient else if combobox1.ItemIndex = 2
then form2.sg1.DrawingStyle.gdsThemed; form2.sg1.UpdateControlState;
end;

Your syntax seems to be totally off. Assuming sg1 is a grid, then
DrawingStyle is a property and you can't set a property like that.
Properties are set with the assignment syntax.

Try something like:

  begin
    case comboBox1.ItemIndex of
      0: form2.sg1.DrawingStyle := gdsClassic;
      1: etc...
    end;
    form2.sg1.UpdateControlState;
  end;


--
Rudy Velthuis http://www.rvelthuis.de

"Say what you will about the Ten Commandments, you must always
come back to the pleasant fact that there are only ten of them."
-- H. L. Mencken
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: XE8 VCL FOR PC: How to repair the below because of fail to compile.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2015 10:02 AM   in response to: hots wally in response to: hots wally
hots wally wrote:

procedure TForm8.ComboBox1Change(Sender: TObject);
begin
if combobox1.ItemIndex = 0 then form2.sg1.DrawingStyle.gdsClassic
else if combobox1.ItemIndex = 1 then
form2.sg1.DrawingStyle.gdsGradient else if combobox1.ItemIndex = 2
then form2.sg1.DrawingStyle.gdsThemed; form2.sg1.UpdateControlState;
end;

Your syntax seems to be totally off. Assuming sg1 is a grid, then
DrawingStyle is a property and you can't set a property like that.
Properties are set with the assignment syntax.

Try something like:

  begin
    case comboBox1.ItemIndex of
      0: form2.sg1.DrawingStyle := gdsClassic;
      1: etc...
    end;
    form2.sg1.UpdateControlState;
  end;


--
Rudy Velthuis http://www.rvelthuis.de

"Say what you will about the Ten Commandments, you must always
come back to the pleasant fact that there are only ten of them."
-- H. L. Mencken
hots wally

Posts: 53
Registered: 6/14/14
Re: XE8 VCL FOR PC: How to repair the below because of fail to compile.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2015 10:10 PM   in response to: hots wally in response to: hots wally
can'b be compiled.

maybe about uses setting? how to solve it?
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: XE8 VCL FOR PC: How to repair the below because of fail to compile.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2015 11:26 PM   in response to: hots wally in response to: hots wally
hots wally wrote:

can'b be compiled.

maybe about uses setting? how to solve it?

Did you see my reply? And "Can't be compiled" is definitely not the
only error message you got.

If you want people to help you, give them all the information they
might need to help you.

--
Rudy Velthuis http://www.rvelthuis.de

"Where it is a duty to worship the sun, it is pretty sure to be
a crime to examine the laws of heat."
-- John Morley
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: XE8 VCL FOR PC: How to repair the below because of fail to compile.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2015 11:29 PM   in response to: hots wally in response to: hots wally
hots wally wrote:

can'b be compiled.

maybe about uses setting? how to solve it?

Did you see my reply? And "Can't be compiled" is definitely not the
only error message you got.

If you want people to help you, give them all the information they
might need to help you.

--
Rudy Velthuis http://www.rvelthuis.de

"Where it is a duty to worship the sun, it is pretty sure to be
a crime to examine the laws of heat."
-- John Morley
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02