BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MDI Child with no caption and flat border

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Saravanan
Guest





PostPosted: Tue Apr 04, 2006 1:03 pm    Post subject: MDI Child with no caption and flat border Reply with quote



Hi,

I want a flat border MDI child window without any caption. I have tried
various combinations listed below

Tryout 1 :
=======

I changed the child form border style to bsNone and

void __fastcall TMDIChild::FormShow(TObject *Sender)
{
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) &
~WS_CAPTION ) ;
SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
SWP_FRAMECHANGED);
}

void __fastcall TMDIChild::OnNCHitTest(TWMNCHitTest& Message)
{
DefaultHandler(&Message);

if ( Message.YPos - 3 < Top )
Message.Result = HTTOP ;
else if ( Message.YPos + 3 > Height + Top ) {
Message.Result = HTBOTTOM ;
}

if ( Message.XPos - 3 < Left ) {
Message.Result = HTLEFT ;
}

else if ( Message.XPos + 3 > Width + Left ) {
Message.Result = HTRIGHT ;
}

if ( Message.YPos - 3 < Top && Message.XPos - 3 < Left )
Message.Result = HTTOPLEFT ;

if ( Message.YPos + 3 > Height + Top && Message.XPos - 3 < Left )
Message.Result = HTBOTTOMLEFT ;

if ( Message.YPos - 3 < Top && Message.XPos + 3 > Width + Left )
Message.Result = HTTOPRIGHT ;

if ( Message.YPos + 3 > Height + Top && Message.XPos + 3 > Width + Left )
Message.Result = HTBOTTOMRIGHT ;
}

childform.h

void __fastcall OnNCHitTest(TWMNCHitTest& Message) ;
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_NCHITTEST, TWMNCHitTest, OnNCHitTest)
END_MESSAGE_MAP(TForm)

I can able to resize the form using the HitTest and cursor appears properly
(Meaning resize cursor is displayed when mouse is moved over the border)

Problem : Border is not flat it is shows as 3d border


Tryout 2 :
=======

I changed the child form border style to bsSingle.

Now the Border Style is flat. Still i can able to resize the form using the
HitTest but cursor not appearing properly. (Meaning resize cursor is not
displayed when mouse is moved over the border)

Regards,
Saravanan A
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.