PDA

Click to See Complete Forum and Search --> : [VB6] to be sure about resize event;)


joaquim
Jan 20th, 2010, 05:02 PM
i know that UserControl has the Resize event, but i need to be sure about something:
- if i change the size of control, by code or mouse or changing the image(picture property), the resize event is always activated?

LaVolpe
Jan 20th, 2010, 05:58 PM
It may not always be activated if the changed size is the same size, in other words, if the end result is the same size.

Changing an image property will not resize the control. You will have to resize the control through code after the image has been accepted/processed. A VB usercontrol does not have an "AutoSize" property.

joaquim
Jan 21st, 2010, 02:17 PM
"Changing an image property will not resize the control. You will have to resize the control through code after the image has been accepted/processed. A VB usercontrol does not have an "AutoSize" property."
But when i change the usercontrol resize(to diferent size and in code), the resize event is activated, right?

LaVolpe
Jan 21st, 2010, 02:53 PM
"Changing an image property will not resize the control. You will have to resize the control through code after the image has been accepted/processed. A VB usercontrol does not have an "AutoSize" property."
But when i change the usercontrol resize(to diferent size and in code), the resize event is activated, right?Yes 99.9% of the time. If you change the size to the same size then it may not be activated.

If you are having problems, describe what those problems are? And also include show us you are sizing your usercontrol

joaquim
Jan 21st, 2010, 03:19 PM
Yes 99.9% of the time. If you change the size to the same size then it may not be activated.

If you are having problems, describe what those problems are? And also include show us you are sizing your usercontrol
i had a small problem, but i belive that you resolve it 50% of the problem.
but i will tell you the problem: in my sprite i have, in a timer(interval=10), the colision event. but these event isn't 100% ok, because, when the UC size is changed, these event isn't 100% working:(
is why that i need put it in move event and in resize event too;)
(the big problem is showed in games section: colision with wall)
thanks

LaVolpe
Jan 21st, 2010, 04:10 PM
I don't know how you are sizing your uc via code. But you should be using the UserControl.Size command.

joaquim
Jan 21st, 2010, 04:16 PM
I don't know how you are sizing your uc via code. But you should be using the UserControl.Size command.
every time the image is showed:
If blnAutoSize = True Then
UserControl.width = PicAnimation(lngActualSubImage).width * Screen.TwipsPerPixelX
UserControl.Height = PicAnimation(lngActualSubImage).Height * Screen.TwipsPerPixelY
end if

LaVolpe
Jan 21st, 2010, 05:18 PM
By doing it that way your Resize event may fire twice, once when width is changed and once again when height is changed
UserControl.Size PicAnimation(lngActualSubImage).Width * Screen.TwipsPerPixelX, _
PicAnimation(lngActualSubImage).Height * Screen.TwipsPerPixelY

joaquim
Jan 22nd, 2010, 08:39 AM
By doing it that way your Resize event may fire twice, once when width is changed and once again when height is changed
UserControl.Size PicAnimation(lngActualSubImage).Width * Screen.TwipsPerPixelX, _
PicAnimation(lngActualSubImage).Height * Screen.TwipsPerPixelY
thanks
know i can do a new update for build another colision way(for the move(that i build) and other for the resize event);)
thanks
(i can't rate you, sorry:()