|
-
Nov 27th, 2007, 08:46 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Label Resize Error ,Please Help !
I would like to resize the label when the form is resized.
But an error pop up 'Invalid call of arguement'
What the problem of my code ?
VB Code:
Private Sub Form_Resize()
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is Label Then
ctrl.Move ctrl.left, ctrl.tOp, _
Me.ScaleWidth - ctrl.left * 2, _
Me.ScaleHeight - ctrl.tOp - ctrl.left
End If
Next
End Sub
Thanks for help
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Nov 27th, 2007, 11:39 PM
#2
Re: Label Resize Error ,Please Help !
When you get the error again, copy line #7 & #8 to your debug/immediate window and and print the result... ? Me.ScaleHeight - ctrl.top - ctrl.left
You will probably find you are trying to set values outside what is valid (negative width or height)
-
Nov 28th, 2007, 12:42 AM
#3
Thread Starter
Hyperactive Member
Re: Label Resize Error ,Please Help !
Yes absolutely true, I get the negative value of width and height ...
I will try modify to code ... thanks
Lavolpe
I saw your imaglist code became contest winner in planet source code..
Congraturation !!
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Nov 28th, 2007, 12:43 AM
#4
Re: Label Resize Error ,Please Help !
You're welcome and thanx for the congrats. In the process of rewriting it now for a "final" release in a week or two; just to get it done & out of the way -- have many more projects on my plate.
-
Nov 28th, 2007, 12:55 AM
#5
Re: [RESOLVED] Label Resize Error ,Please Help !
Oh, one more piece of advice before I log off for the night.
In your resize event, always check if Me.WindowState=vbMinimized and then exit sub if it's true. Reszing when minimized generates errors too.
-
Nov 28th, 2007, 12:57 AM
#6
Thread Starter
Hyperactive Member
Re: [RESOLVED] Label Resize Error ,Please Help !
Ok thanks LaVolpe,I will take note for what you have been mentioned
Good Night and Sweet Dream.
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
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
|