Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Resizing window problems.

Posted on 2002-05-08
2
Medium Priority
?
401 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 400 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 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