Re: VB6 form "zooming" resize a form and all it's components



On Fri, 22 Jul 2005 13:39:57 +0100, Jan Hyde
<StellaDrinker@xxxxxxxxxxxxxxxxxxx> wrote:

>Helmut Wabnig <hxwabnig@xxxxxxxxxx>'s wild thoughts were
>released on Fri, 22 Jul 2005 14:12:08 +0200 bearing the
>following fruit:
>
>>Hi,
>>may I ask a VB6 question:
>>
>>How do I resize a form and it's components at run-time
>>with the mouse in VB6.
>>Example "digital clock" consisting of 1 form & 1 label field
>>which displays time.
>>Pull the lower right corner of the form and change the formsize,
>>label size and (true type) fontsize while maintaining aspect ratio,
>>making the "clock" larger ór smaller, like "zooming".
>>
>
>You add code to the form's resize event.
>
Yep, I have seen it and I know it is possible, but...

1) make form ratio fixed

>Private Sub Form_resize()
> Me.Height = Me.Width / 3.33

number 3,33 found by experiments


2) Now do I make the Label same size as the form

> lblLabel1.Width = Me.Width
> lblLabel1.Height = Me.Height

That will work and the label fills the form

3.)

>lblLabel1.FontSize = Me.ScaleWidth / 80 - 3
Fontsize changes while moving the mouse


by experimenting a little with the numbers I got results
which are ALMOST useable, but not correct when
frame is very small or very large.
Small frames will cut the fonts at bottom,
large frames will have excess space in the label.

=====================================================

There is a way to do that more precisely, because I have seen it.
But how it is done I do not know.
There are Myriads of tutorials and demos on the web,
but I have not seen *one* which takes into account
different screen resolutions from VGA to HDTV.
A label which is just readable in VGA will be like a small icon
on a high definition monitor.

It's just a dirty little trick, I suppose.

w.
.



Relevant Pages

  • Re: VB6 form "zooming" resize a form and all its components
    ... Small frames will cut ... > in the label. ... Private clientRatio As Single ... Private Sub Form_Resize ...
    (comp.lang.basic.visual.misc)
  • RE: User form with sliding separator on a list - how to do it?
    ... label box but didn't know how. ... The only question or thing I'm not sure about is in the calculation, ... just don't know how to pull some of these value and resize ... I'm trying to figure out how to do this in a user form and have no idea how ...
    (microsoft.public.excel.programming)
  • Re: Shape Data_Callout_Text_Resizing
    ... I have a basic rectangle with 5-off callouts and 3-off headings associated ... To resize text as I resize shape... ... Label from callout resizes ... Value from callout does not resize ...
    (microsoft.public.visio.general)
  • Re: Frame trouble
    ... The typical solution is to create a frame that will contain the image, group, start date and end date frames, then pack the image on the left then the other frames top-to-bottom. ... I'd also recommend *not* making all your widgets children of interior frames. ... label .mainHeading -text "Welcome to Inspector" ...
    (comp.lang.tcl)
  • Re: Sizing a Label
    ... A suitable control handle could do the trick! ... The label control simply needs resize handles... ... to be user-friendly and with every new generation, the design is ...
    (microsoft.public.visio.general)