Is there any way to know when the form has been resized so that I can resize my UserControl to be as large as the form that contains it??
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
??? Would you not use the Form_Resize event to set the usercontrol dimensions. This would then fire the UserControl.Resize event. You would then adjust it's child controls, for instance a Textbox that fills the entire container.
Code:
Private Sub Form_Resize()
Me.UserControl11.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
Code:
Private Sub UserControl_Resize()
Text1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
Thanks, but I was looking for a way where the coder didn't have to add code to get it working. And... a way which didn't involve a timer polling for the dimensions.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
You would need to capture the parent form's events. Declare a variable of type Form using WithEvents. Then set this variable equal to the UserControl.Parent (you would probably need to check if the parent control is indeed a form).
Then, since you now have access to the Forms events, your usercontrol could have code in the Form_Resize event.
It doesn't seem to work:
"Object or class does not support the set of events"
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Yes... that seems to work, but is there any way to change the left or top properties of the UserControl?
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
I have not tried to set it in the ReadProperties.. maybe that's what the main problem.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Originally posted by Mc Brain I have not tried to set it in the ReadProperties.. maybe that's what the main problem.
However... the main problem was that I was not checking about the UserControl.Ambient.UserMode
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.