Solved

Resizing window problems.

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

821 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