• Welcome to Valhalla Legends Archive.
 

Resizing...

Started by Fr0z3N, March 15, 2003, 07:16 PM

Previous topic - Next topic

Banana fanna fo fanna

#15
yeah ok

MrRaza

#16
I wish his avatar was in color too  ::) ;D

Fr0z3N

#17
Haze, I know NOTHING about resizing and It's hard to learn when ppl throw there code at you and not explain what each function does.

Grok

#18
Frozen,

I spent a good 15-20 minutes preparing a clear answer for you, including a screenshot.  That's 20 minutes out of my day that I will spend elsewhere in the future, if you are so ungrateful.

My code only had ONE method in it, ".move" which only takes four arguments.  Left, Top, Width, Height.  You can easily read out .move in MSDN online or in VB Help.  It is not my responsibility to help you at all, much less teach you the syntax of the only command you needed.

Finally, it was all written in good will as a response to a question that YOU ASKED.  Surely you can take the time to study the code in the best of all replies given to you.  I even told you how to build the form and which controls to put on it so that the code sample would work.

Don't bite the hand that feeds you.

Fr0z3N

#19
Sorry Grok, I haven't tryed your way yet I was refering to warz way. I'll go try your way.

Banana fanna fo fanna

#20
Fucking shit, here's your goddamn answer you ungrateful son of a bitch.

put:
Dim PrevResizeX
Dim PrevResizeY

at the top of your form

then do this
Public Function ResizeAll(FormName As Form)
    Dim tmpControl As Control
    On Error Resume Next
    'Ignores errors in case the control does
    '     n't
    'have a width, height, etc.


    If PrevResizeX = 0 Then
        'If the previous form width was 0
        'Which means that this function wasn't r
        '     un before
        'then change prevresizex and y and exit


'     function
    PrevResizeX = FormName.ScaleWidth
    PrevResizeY = FormName.ScaleHeight
    Exit Function
End If


For Each tmpControl In FormName
    'A loop to make tmpControl equal to ever
    '     y
    'control on the form


    If TypeOf tmpControl Is Line Then
        'Checks the type of control, if its a
        'Line, change its X1, X2, Y1, Y2 values
        tmpControl.x1 = tmpControl.x1 / PrevResizeX * FormName.ScaleWidth
        tmpControl.x2 = tmpControl.x2 / PrevResizeX * FormName.ScaleWidth
        tmpControl.Y1 = tmpControl.Y1 / PrevResizeY * FormName.ScaleHeight
        tmpControl.Y2 = tmpControl.Y2 / PrevResizeY * FormName.ScaleHeight
        'These four lines see the previous ratio
        '
        'Of the control to the form, and change
        '     they're
        'current ratios to the same thing
    Else
        'Changes everything elses left, top
        'Width, and height
        tmpControl.Left = tmpControl.Left / PrevResizeX * FormName.ScaleWidth
        tmpControl.Top = tmpControl.Top / PrevResizeY * FormName.ScaleHeight
        tmpControl.Width = tmpControl.Width / PrevResizeX * FormName.ScaleWidth
        tmpControl.Height = tmpControl.Height / PrevResizeY * FormName.ScaleHeight
        'These four lines see the previous ratio
        '
        'Of the control to the form, and change
        '     they're
        'current ratios to the same thing
    End If
Next tmpControl
PrevResizeX = FormName.ScaleWidth
PrevResizeY = FormName.ScaleHeight
'Changes prevresize x and y to current w
'     idth
'and height
End Function


then in your form_resize event

ResizeAll me

Fr0z3N

#21
I didn't mean to sound so ungrateful, I'm sorry and that code works, thanks.

Banana fanna fo fanna

#22
har don't worry about it
i was kidding

Fr0z3N

#23
you always sound so serious,  :P

Banana fanna fo fanna

#24
I don't mean half the stuff I post anyway.

Fr0z3N

#25
lol, so you really have 100 meaning full posts?  ;D

Banana fanna fo fanna

#26
Approximately.

MailMan

#27
Thank you for that, storm.id, that was a very neat and helpful function.

Fr0z3N

STORM! that function fucks up when you minamize bot http://www.blizzside.com/madz/download.php?op=getit&lid=74
theres link to my bot if you wanna see




Edit; got ss working

haZe

#29
Yeah, When you minimize it, for me, it makes my RTB and everything else on my form invisible...

|