Solved

Resizing window problems.

Posted on 2002-05-08
2
398 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

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…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

728 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