|
-
Jun 1st, 2000, 04:39 AM
#1
Thread Starter
Hyperactive Member
Okay - I know that some time ago I saw some posts where someone had created a user control that would resize all controls whenever the user resizes the form. Of course now that I want to look at it, I can't find it! can whoever has that please repost it, or if someone else has something similiar?
Thanks
Andrew
-
Jun 1st, 2000, 06:59 AM
#2
Hyperactive Member
I know there is a control called resize.ocx. Look it up on the Net. You probably have to pay for it, though.
-
Jun 1st, 2000, 10:32 AM
#3
Fanatic Member
Some Code?
How about some code instead and you can change it into a control and mail me one.
I have emailed the code to you, as i still have not got the hang of this BB - all my code is always left formatted!
DocZaf
{;->
'==> Code
the following code is all in the form module
Create a form drop some controls on it
and resize it at runtime
Option Explicit
Private Type ControlsSizes
csTop As Single
csLeft As Single
csWidth As Single
csHeight As Single
End Type
Private AllControls() As ControlsSizes
Private Sub Form_Initialize()
Dim counta As Integer
ReDim Preserve AllControls(Controls.Count - 1)
For counta = 0 To Controls.Count - 1
With AllControls(counta)
.csTop = Controls(counta).Top / ScaleHeight
.csLeft = Controls(counta).Left / ScaleWidth
.csWidth = Controls(counta).Width / ScaleWidth
.csHeight = Controls(counta).Height / ScaleHeight
End With
Next
End Sub
Private Sub Do_Resize()
Dim counta As Integer
For counta = 0 To Controls.Count - 1
With AllControls(counta)
Controls(counta).Move .csLeft * ScaleWidth, .csTop * ScaleHeight, .csWidth * ScaleWidth, .csHeight * ScaleHeight
End With
Next
End Sub
Private Sub Form_Resize()
Do_Resize
End Sub
Sorry about the lack of comments, but its simple enoughto understand.
Zaf
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|