[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
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)
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 !!
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.
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.
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.