I have managed to create a solution which lets Win32::GUI::Grid do the work for me

That gets me an area of the screen that holds my Labels (in practice these are a 4 wide x X deep grid of pictures for my app) The labels are contained by the grid and no longer go over the status bar and the Grid control makes the scroll bars around itself appear and disappear as needed.

In its simplest form here is some code.

I would recommend using $Grid->AutoSize() just before $main->Show(); for a real grid to do the sizing but for this eaxmple I wanted 80 x 80 cells to make the scrollbar appear

If you resize the window then the scrollbr should come and go

use Win32::GUI; use Win32::GUI::Grid; use warnings; use strict; my $main = Win32::GUI::Window->new( -name => "Main", -title => "Test", -pos => [100, 100], -size => [200, 200], ) or die "new Window"; my $Grid = $main->AddGrid ( -name => "Grid", -pos => [20, 20], ) or die "new Grid"; $Grid->SetColumns(1); $Grid->SetRows(2); $Grid->SetRowHeight(0, 80); $Grid->SetRowHeight(1, 80); $Grid->SetColumnWidth(0, 80); $Grid->SetCellText(0, 0, 'Cell 1'); $Grid->SetCellText(1, 0, 'Cell 2'); my $sb = $main->AddStatusBar(); $main->Show(); Win32::GUI::Dialog(); sub Window_Terminate { return -1; } sub Main_Resize { $sb->Move(0, $main->ScaleHeight - $sb->Height); $sb->Resize($main->ScaleWidth, $sb->Height); my ($width, $height) = ($main->GetClientRect)[2..3]; $Grid->Resize (110, $height - $sb->Height - 20); }

In reply to Re^4: Possible solution to Win32 GUI scrolling controls within the main window by SteveR
in thread Win32 GUI scrolling controls within the main window by SteveR

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.