Solved

Resizing window problems.

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now