|
-
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
|