• Welcome to Valhalla Legends Archive.
 

Resizing...

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

Previous topic - Next topic

Fr0z3N

how do you make everything on your form resize when you resize your form?

like txt's rtb's cmd's lv's
i have no clue so explain slowly please

warz

#1
well youd put the .heigh .top and .width to use,,,
exampel:

Private Sub Form_Resize()
On Error Resume Next
    Text3.Left = Me.Width - 1000
    Text3.Height = Me.Height - 750
    Text3.Width = 735
    
    Text1.Height = Text3.Height
    Text1.Width = (Me.Width - Text3.Width) - 600
    
    Text2.Width = Text1.Width
    Text2.Top = Me.ScaleHeight - 400
End Sub

i uplaoded the form to lakctech at htto?://tks.slacktech.com under visubal basic source code

Fr0z3N

#2
Yes but I dont know what to do with the numbers to make them the size of my shit or w/e

warz

Mess around with them, it's not that hard.

Noodlez

#4
wow... thats some amazing self restraint

should always use Me.ScaleX instead of Me.X (Me.ScaleHeight as opposed to Me.Height for those of you that were born disadvantaged)

Grok

#5
Quotewow... thats some amazing self restraint

should always use Me.ScaleX instead of Me.X (Me.ScaleHeight as opposed to Me.Height for those of you that were born disadvantaged)

Should also use Obj.Move instead of setting the properties directly.

Fr0z3N

#6
huh?

Banana fanna fo fanna

You have to think to do this you know.

Type it into fucking google for christs sake.

*takes over warz's job*

Grok

Here is an example from an MDI child form I use:

Private Sub Form_Resize()
    txtTalk.Move 0, Me.ScaleHeight - CoolBar1.Height - txtTalk.Height, Me.ScaleWidth
    picRoom.Move 0, 0, Me.ScaleWidth - picUsers.Width
    picUsers.Move picRoom.Width, 0, lvUsers.Width
    rtb.Move 0, picRoom.Height, Me.ScaleWidth - lvUsers.Width, Me.ScaleHeight - CoolBar1.Height - txtTalk.Height - picRoom.Height
    lvUsers.Move rtb.Width, rtb.Top, lvUsers.Width, rtb.Height
End Sub


To see it work, put these objects on a form:

TextBox txtTalk
PictureBox picRoom
PictureBox picUsers
RichTextBox rtb
ListView lvUsers
CoolBar CoolBar1 (align to bottom of form)

Run it and watch how the code resizes each control during the form_resize event.  That should get you started.

warz

#9
yeah frozen is pretty stupid, eh?

Banana fanna fo fanna

#10
Fake warz eh?

Fr0z3N

#11
i dunno if its stupid or it works all i know is its confusing and complicated

warz

#12
Fake warz? What the shit. Who would want to be me?
I pitty the wanksta who attempts to take over my
name.

Fr0z3N

#13
lol warz

haZe

#14
Fr0z3n If you can't make something out of what Grok said, which is a perfect example, then I don't mean to flame or anything but take some time to learn VB. No, that wasn't a flame, it was a suggestion.