Solved

Resizing window problems.

Posted on 2002-05-08
2
397 Views
Last Modified: 2013-12-03
Ok, here's my setup:

I have a program in which the main window consists of the following:

3 list boxes
1 edit box
2 buttons.

2 of the list boxes are stacked on top of each other, the third runs the height of the first two, but is along the right edge.

The edit box runs along the bottom of this entire mess
the buttons are below the edit box.

Ok, first off - the problems is with resizing the list boxes.

I can change the size of the window via dragging the corner (duh;) and I have it so that it will lock to a minimum screen size.

The list boxes are resizing, BUT:

they jump.

Instead of resizing gracefully, leaving the same gap between the boxes, they jump what appears to be an entire character size each time.

Is there a way to change this so I can have them looking nice and maintaining my spacing?  Mostly because I have text between each of the listbox and edit box windows, and the spacing keeps screwing that up, sometimes it looks correct, other times, well, half the words are covered.

here is my wm_size case:

     case WM_SIZE:
          SendMessage(hStatus, WM_SIZE, 0, 0);

          GetWindowRect(hStatus, &rcStatusBar);
         iStatusHeight = rcStatusBar.bottom - rcStatusBar.top;

         GetClientRect(hwnd, &rcMainWnd);
         iMainHeight = rcMainWnd.bottom - iStatusHeight-100;

          siListWidth = rcMainWnd.right - rcMainWnd.left-LISTOFFSET;
          siAdminWidth = rcMainWnd.right -(rcMainWnd.right - rcMainWnd.left-LISTOFFSET);

          MoveWindow(hList,0,TOPOFFSET,rcMainWnd.right - rcMainWnd.left-LISTOFFSET, iMainHeight-CHATOFFSET,TRUE);
         

          MoveWindow(hServerResponse,0,iMainHeight-SERVEROFFSET,rcMainWnd.right-rcMainWnd.left-LISTOFFSET,
               95, TRUE);

         
          MoveWindow(hChatters,rcMainWnd.right-rcMainWnd.left-LISTOFFSET,TOPOFFSET,LISTOFFSET, iMainHeight,TRUE);


          MoveWindow(hEditBox,0,iMainHeight+5, rcMainWnd.right-rcMainWnd.left-(LISTOFFSET+20),
               25,TRUE);
     
          MoveWindow(hStart,rcMainWnd.right - rcMainWnd.left-LISTOFFSET,iMainHeight,
               rcMainWnd.right -(rcMainWnd.right - rcMainWnd.left-LISTOFFSET),     20, TRUE);
          MoveWindow(hStop,rcMainWnd.right - rcMainWnd.left-LISTOFFSET,iMainHeight+20,
               rcMainWnd.right -(rcMainWnd.right - rcMainWnd.left-LISTOFFSET),     20, TRUE);
     
          return 0;
0
Comment
Question by:navigator010897
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
GGRUNDY earned 100 total points
ID: 6997624
You probably need to ensure that your listbox has the VLBS_NOINTEGRALHEIGHT style set.
0
 
LVL 1

Author Comment

by:navigator010897
ID: 6997689
Hey cool!  I never knew about that attribute!  I always thought that some sort of math had to be done for it in the WMSize.  This makes it much easier!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question