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
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
Yes but I dont know what to do with the numbers to make them the size of my shit or w/e
Mess around with them, it's not that hard.
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)
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.
huh?
You have to think to do this you know.
Type it into fucking google for christs sake.
*takes over warz's job*
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
(http://www.valhallalegends.com/images/Resize1.jpg)
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.
yeah frozen is pretty stupid, eh?
Fake warz eh?
i dunno if its stupid or it works all i know is its confusing and complicated
Fake warz? What the shit. Who would want to be me?
I pitty the wanksta who attempts to take over my
name.
lol warz
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.
yeah ok
I wish his avatar was in color too ::) ;D
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.
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.
Sorry Grok, I haven't tryed your way yet I was refering to warz way. I'll go try your way.
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
I didn't mean to sound so ungrateful, I'm sorry and that code works, thanks.
har don't worry about it
i was kidding
you always sound so serious, :P
I don't mean half the stuff I post anyway.
lol, so you really have 100 meaning full posts? ;D
Approximately.
Thank you for that, storm.id, that was a very neat and helpful function.
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
(http://www.frozcreations.com/Fr0zChat.JPG)
Edit; got ss working
Yeah, When you minimize it, for me, it makes my RTB and everything else on my form invisible...
Same!
if windowstate = vbminimized then exit sub
where would that go :o
Underneath Public Sub Resizeall blah blah
[edit] spelling