Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

breaking inherited properties 1

Status
Not open for further replies.

leopardo

Technical User
May 14, 2005
18
AR
Working with D2.

I have a groupbox1 with a caption inside refering some component tasks, it's intended that in some cases this caption being visible or not depending on events. But beacuse groupbox1 is always visible the code

captionname.visible := false;

is never accomplished.

How can I change the properties of child objetcts ?.

Leopardo.
 
Do you mean, make the caption of the group box blank?
If so, couldn't you just do:
Code:
groupbox1.caption := '';
 
You cannot lower visibility in descendant classes.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is always another way to solve it, but I prefer my way.
 
I was referring to a caption of a component contened in groupbox1, thanks anyway, xdracox.

Sad But True. Nordlund is seemingly right. [sadeyes]
 
I don't understand. This works fine for me:
Code:
unit Main;

interface

uses
  Windows, Classes, Controls, Forms, StdCtrls;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    StaticText1: TStaticText;
    CheckBox1: TCheckBox;
    procedure CheckBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  StaticText1.Visible := CheckBox1.Checked;
end;

end.
 
Zathras he is using Delphi 2, and there are a lot of differences between the later versions, which can be attributed to either Delphi or the operating system used. Delphi makes heavily use of the embedded windows components (the Win32 palette). The TreeView, Listview, StatusBar, monthCalendar, Toolbar are all components that are part of the OS.
I know that Delphi 3 had the Palette Win 3.11, which had the visual components with exact the same look as windows explorer at that time.

I developped an application on a NT OS using a PageControl Object. I tested it on NT, Win98, ME, now it is installed on Win2000 and XP. The appearance is still the same, it works.
It was installed also on a Win95 computer and by accident I discovered that the caption of the Tabsheets didn't display. The Tabs were there but the caption did not appear. [ponder]
Then I found out that it had to do with comctl32.dll found in the system32 directory of the OS.
Never found a work-around, but I had also a MainMenu, duplicating the funcionality, thus a (not computer savy) Win-95 user I instructed using the MainMenu. [sunshine]

Steven
 
My apologies for you all, forgive me.

I've just corrected my codes and I obtained what I want and commented in my first posting, forgive me again. I work with D2 in W98SE and in agreement with svanles and Zathras the properties of embedded objects can be handled. By the way, your comment is very substantial, svanels.

Thanks you all friends [bigcheeks]
 
Leopardo, I don't know in which part of the world (I presume spanish or portugese speeking), but maybe there is an easy way of upgrading. Computer magazines nowadays enclude CD's with shareware, utilities and demos. Sometimes you can hit a "jackpot". I once encountered Delphi 3, Client-Server edition. Oke Delphi was already at version 6, but comparing the price of the equivalent Enterprice edition US $3000 x US $7 (the price of the magazine), it was the solution for small budget Delphi Fanatics.
Delphi 2 was included in the Delphi 3 standard edition I bought in 1997 for US $100 and came with the book Learning delpi 3 in 21 days from Sam's Publishing.

So Leopardo there are plenty of ways to upgrade to a higher version, I just sticked at Delphi 6, it does the work and in the near future an upgrade is not in my plans.

Regards

Steven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top