Board index » cppbuilder » Alignment doesn't work with WindowState = wsMaximized...

Alignment doesn't work with WindowState = wsMaximized...

Hi once again.
I have a Form which only contains an Timage. This Image should always be
placed in the top right corner.
So I placed it in this corner and set the anchors to [akTop, akRight]. This
works fine as long as the window isn't maximized..
when i set the Window-State option to wsMaximized, I have my picture
somewhere in the middle...

I already tried to set the Align property to alRight, but that didn't solve
the problem...

Thanks for your help!

Mathias

 

Re:Alignment doesn't work with WindowState = wsMaximized...


Quote
Mathias Michaelis wrote:

> Hi once again.
> I have a Form which only contains an Timage. This Image should always be
> placed in the top right corner.
> So I placed it in this corner and set the anchors to [akTop, akRight]. This

What are the anchors ?

Quote
> works fine as long as the window isn't maximized..
> when i set the Window-State option to wsMaximized, I have my picture
> somewhere in the middle...

void __fastcall TForm1::FormResize(TObject *Sender)
{
Image1->Top=0;
Image1->Left=ClientWidth-Image1->Width;

Quote
}

Maybe you have to call FormResize() in OnShow too.

Hans.

Other Threads