Dialog box sizing 
Author Message
 Dialog box sizing

hi,
I designed a Dialogbox in VC++ 6 and use CreateDialog to display it, my irc
client
is almost done and I have a question about the resizing of the dialogbox I
want all
objects to "size" with the dialogbox (so I want my richedit and editbox to
become
bigger when you make the dialogbox bigger etc.) How do I do that? Do I have
to
catch off a resize message?

thanks,
Matthijs



Thu, 17 Feb 2005 18:27:59 GMT  
 Dialog box sizing

Quote:

> hi,
> I designed a Dialogbox in VC++ 6 and use CreateDialog to display it, my irc
> client
> is almost done and I have a question about the resizing of the dialogbox I
> want all
> objects to "size" with the dialogbox (so I want my richedit and editbox to
> become
> bigger when you make the dialogbox bigger etc.) How do I do that? Do I have
> to
> catch off a resize message?

> thanks,
> Matthijs

Handle the WM_SIZE message in the dialog box.  It is passed the new cx
and cy client dimensions.  You can use those numbers to compute the
desired new size of the child windows, then call MoveWindow on each
child.

There is a {*filter*} trap to watch out for in a WM_SIZE handler: It is
called before the child windows have been created, which will make
MoveWindow assert. So put in a check like:

if (m_richedit.GetSafeHwnd())
{
  m_richedit.MoveWindow(...);

Quote:
}

--
Scott McPhillips [VC++ MVP]


Thu, 17 Feb 2005 23:04:40 GMT  
 Dialog box sizing


Quote:
> Handle the WM_SIZE message in the dialog box.  It is passed the new cx
> and cy client dimensions.  You can use those numbers to compute the
> desired new size of the child windows, then call MoveWindow on each
> child.

> There is a {*filter*} trap to watch out for in a WM_SIZE handler: It is
> called before the child windows have been created, which will make
> MoveWindow assert. So put in a check like:

> if (m_richedit.GetSafeHwnd())
> {
>   m_richedit.MoveWindow(...);
> }

I'm working with Winapi actualy so I don't use membervars and I have no idea
how to
resize the objects. If you could tell me a bit more that would realy help!
thanks,
Matthijs


Fri, 18 Feb 2005 03:11:18 GMT  
 Dialog box sizing

Quote:



> > Handle the WM_SIZE message in the dialog box.  It is passed the new cx
> > and cy client dimensions.  You can use those numbers to compute the
> > desired new size of the child windows, then call MoveWindow on each
> > child.

> > There is a {*filter*} trap to watch out for in a WM_SIZE handler: It is
> > called before the child windows have been created, which will make
> > MoveWindow assert. So put in a check like:

> > if (m_richedit.GetSafeHwnd())
> > {
> >   m_richedit.MoveWindow(...);
> > }
> I'm working with Winapi actualy so I don't use membervars and I have no idea
> how to
> resize the objects. If you could tell me a bit more that would realy help!
> thanks,
> Matthijs

Sorry, the solution is practically the same without MFC.  Handle the
WM_SIZE message in your DialogProc.  Your WM_SIZE handler should call
MoveWindow for each child.

--
Scott McPhillips [VC++ MVP]



Fri, 18 Feb 2005 05:21:42 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. multiple dialog box sizes

2. Dialog box size

3. Actual dialog box size

4. How to retrieve initial dialog box size?

5. Screen resolution <-> dialog box size :-(

6. get dialog box size

7. dialog size in evc++ dialog editor not the same as size in pixels on device

8. Get size of dialog box

9. Sizing Dialog Box

10. How to change the color,size,font of text in a dialog box

11. Sizing of controls in Dialog Box

12. font size of dialog box

 

 
Powered by phpBB® Forum Software