|
-
Jan 20th, 2010, 06:02 PM
#1
Thread Starter
PowerPoster
[VB6] to be sure about resize event;)
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?
-
Jan 20th, 2010, 06:58 PM
#2
Re: [VB6] to be sure about resize event;)
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.
-
Jan 21st, 2010, 03:17 PM
#3
Thread Starter
PowerPoster
Re: [VB6] to be sure about resize event;)
"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?
-
Jan 21st, 2010, 03:53 PM
#4
Re: [VB6] to be sure about resize event;)
 Originally Posted by joaquim
"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
-
Jan 21st, 2010, 04:19 PM
#5
Thread Starter
PowerPoster
Re: [VB6] to be sure about resize event;)
 Originally Posted by LaVolpe
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
-
Jan 21st, 2010, 05:10 PM
#6
Re: [VB6] to be sure about resize event;)
I don't know how you are sizing your uc via code. But you should be using the UserControl.Size command.
-
Jan 21st, 2010, 05:16 PM
#7
Thread Starter
PowerPoster
Re: [VB6] to be sure about resize event;)
 Originally Posted by LaVolpe
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:
Code:
If blnAutoSize = True Then
UserControl.width = PicAnimation(lngActualSubImage).width * Screen.TwipsPerPixelX
UserControl.Height = PicAnimation(lngActualSubImage).Height * Screen.TwipsPerPixelY
end if
-
Jan 21st, 2010, 06:18 PM
#8
Re: [VB6] to be sure about resize event;)
By doing it that way your Resize event may fire twice, once when width is changed and once again when height is changed
Code:
UserControl.Size PicAnimation(lngActualSubImage).Width * Screen.TwipsPerPixelX, _
PicAnimation(lngActualSubImage).Height * Screen.TwipsPerPixelY
-
Jan 22nd, 2010, 09:39 AM
#9
Thread Starter
PowerPoster
Re: [VB6] to be sure about resize event;)
 Originally Posted by LaVolpe
By doing it that way your Resize event may fire twice, once when width is changed and once again when height is changed
Code:
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 )
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
|