Results 1 to 9 of 9

Thread: [VB6] to be sure about resize event;)

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,959

    [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?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,959

    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?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [VB6] to be sure about resize event;)

    Quote Originally Posted by joaquim View Post
    "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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,959

    Re: [VB6] to be sure about resize event;)

    Quote Originally Posted by LaVolpe View Post
    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
    VB6 2D Sprite control

    To live is difficult, but we do it.

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,959

    Re: [VB6] to be sure about resize event;)

    Quote Originally Posted by LaVolpe View Post
    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
    VB6 2D Sprite control

    To live is difficult, but we do it.

  8. #8
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  9. #9

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,959

    Re: [VB6] to be sure about resize event;)

    Quote Originally Posted by LaVolpe View Post
    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)
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width