Re: VB6 form "zooming" resize a form and all it's components
- From: Helmut Wabnig <hxwabnig@xxxxxxxxxx>
- Date: Fri, 22 Jul 2005 15:24:24 +0200
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.
.
- Follow-Ups:
- Re: VB6 form "zooming" resize a form and all it's components
- From: Mike Williams
- Re: VB6 form "zooming" resize a form and all it's components
- References:
- VB6 form "zooming" resize a form and all it's components
- From: Helmut Wabnig
- VB6 form "zooming" resize a form and all it's components
- Prev by Date: [ANN] Dr.Explain Documents Your VB Application Automatically
- Next by Date: Re: [ANN] Dr.Explain Documents Your VB Application Automatically
- Previous by thread: VB6 form "zooming" resize a form and all it's components
- Next by thread: Re: VB6 form "zooming" resize a form and all it's components
- Index(es):
Relevant Pages
|