Board index » cppbuilder » WindowState is not a member of TForm?

WindowState is not a member of TForm?


2008-02-06 08:27:14 PM
cppbuilder114
I'm trying to get a bcb6 app to run under bcb 2007. In bcb2007 I've set a
breakpoint in the FormShow method of the main form. In the IDE I've set
MainForm->WindowState = wsMaximized.
When I inspect MainForm->WindowState at the MainForm->FormShow breakpoint it
returns wsNormal (in bcb6 it returns wsMaximized at the same point). Why is
this and why does evaluating MainForm->WindowState return the error
"WindowState is not a member of MainForm"? In fact MainForm->Width returns a
similar message. The only way to get the values of these properties is to
open an Inspector window for MainForm.
 
 

Re:WindowState is not a member of TForm?

If no one can answer this can someone at least confirm that it isn't normal
for bcb2007?
"Tom Byars" < XXXX@XXXXX.COM >wrote in message
Quote
I'm trying to get a bcb6 app to run under bcb 2007. In bcb2007 I've set a
breakpoint in the FormShow method of the main form. In the IDE I've set
MainForm->WindowState = wsMaximized.

When I inspect MainForm->WindowState at the MainForm->FormShow breakpoint
it returns wsNormal (in bcb6 it returns wsMaximized at the same point).
Why is this and why does evaluating MainForm->WindowState return the error
"WindowState is not a member of MainForm"? In fact MainForm->Width returns
a similar message. The only way to get the values of these properties is
to open an Inspector window for MainForm.

 

Re:WindowState is not a member of TForm?

"Tom Byars" < XXXX@XXXXX.COM >wrote in message
Quote
If no one can answer this can someone at least confirm that it isn't
normal for bcb2007?
Maybe this is not what you are doing, but I did the following in BCB 2007
and it worked correctly:
1) New VCL Forms project.
2) Set Form1's WindowState to wsMaximized in the designer.
3) Add handler for FormShow; set breakpoint in it.
4) Build in Debug configuration and run.
The form does start maximized. When I hit the breakpoint, I can add
"Form1->WindowState" to the Watch List, and it correctly shows wsMaximized.
Also, "this->Forms::TCustomForm::FWindowState" in the Local Variables list
correctly shows wsMaximized.
It appears to work for me, maybe I am not doing the same thing you are
doing? If you make a minimal BCB6 project that does this in BCB2007 and post
it, I can try testing it too.
Jason
 

{smallsort}

Re:WindowState is not a member of TForm?

Jason, thanks for your time. I don't know if it's anything to do with the
fact that my forms are derived from base forms. e.g. If I call up the
Inspector for the form and look up the Properties in alphabetic order there
are two WindowState properties and several Width properties. Anyone know if
that's why I get a 'WindowState is not a member of MyDerivedForm' etc. if I
try to set a watch? Do I have to qualify the property to remove ambiguity or
something? I don't in bcb6.
"Jason Cipriani" < XXXX@XXXXX.COM >wrote in message
Quote
"Tom Byars" < XXXX@XXXXX.COM >wrote in message
news:47aae19a$ XXXX@XXXXX.COM ...
>If no one can answer this can someone at least confirm that it isn't
>normal for bcb2007?

Maybe this is not what you are doing, but I did the following in BCB 2007
and it worked correctly:

1) New VCL Forms project.
2) Set Form1's WindowState to wsMaximized in the designer.
3) Add handler for FormShow; set breakpoint in it.
4) Build in Debug configuration and run.

The form does start maximized. When I hit the breakpoint, I can add
"Form1->WindowState" to the Watch List, and it correctly shows
wsMaximized. Also, "this->Forms::TCustomForm::FWindowState" in the Local
Variables list correctly shows wsMaximized.

It appears to work for me, maybe I am not doing the same thing you are
doing? If you make a minimal BCB6 project that does this in BCB2007 and
post it, I can try testing it too.

Jason


 

Re:WindowState is not a member of TForm?

Tom Byars wrote:
Quote
I'm trying to get a bcb6 app to run under bcb 2007. In bcb2007 I've set
a breakpoint in the FormShow method of the main form. In the IDE I've
set MainForm->WindowState = wsMaximized.

When I inspect MainForm->WindowState at the MainForm->FormShow
breakpoint it returns wsNormal (in bcb6 it returns wsMaximized at the
same point). Why is this and why does evaluating MainForm->WindowState
return the error "WindowState is not a member of MainForm"? In fact
MainForm->Width returns a similar message. The only way to get the
values of these properties is to open an Inspector window for MainForm.
Try turning off all optimizations.
Danzer
 

Re:WindowState is not a member of TForm?

They are already all off danzer.
"danzer" <.>wrote in message news:47ab2a04$ XXXX@XXXXX.COM ...
Quote
Tom Byars wrote:
>I'm trying to get a bcb6 app to run under bcb 2007. In bcb2007 I've set
>a breakpoint in the FormShow method of the main form. In the IDE I've
>set MainForm->WindowState = wsMaximized.
>
>When I inspect MainForm->WindowState at the MainForm->FormShow
>breakpoint it returns wsNormal (in bcb6 it returns wsMaximized at the
>same point). Why is this and why does evaluating MainForm->WindowState
>return the error "WindowState is not a member of MainForm"? In fact
>MainForm->Width returns a similar message. The only way to get the
>values of these properties is to open an Inspector window for MainForm.

Try turning off all optimizations.

Danzer