Results 1 to 6 of 6

Thread: AnimateWindow Problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    AnimateWindow Problem

    When my program loads, I would like the form to slide smoothly up from the task bar just like alert messages in Microsoft AntiSpyware. I have gotten my form to slide up, but it is not smooth and there is weird looking black area above the form as it is sliding up.

    What could be causing this?

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: AnimateWindow Problem

    Welcome to VBF!

    Can you post your code?


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: AnimateWindow Problem

    Have you tried my submission from the CodeBank? I suggest using the code from post #22. You can add the FormAnimator class to your project and then you would simply add a class-level variable to your Form of type FormAnimator something like this:
    VB Code:
    1. Private animator As New FormAnimator(Me, _
    2.                                          FormAnimator.AnimationMethod.Slide, _
    3.                                          FormAnimator.AnimationDirection.Up, _
    4.                                          300)
    and you should find that it slides up smoothly.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    Re: AnimateWindow Problem

    jmcilhinney,

    Your code was very similiar to mine, but I tried yours and it has the exact same problem. I'm using a custom shape form with transparency(not Regions), could that have something to do with it?

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: AnimateWindow Problem

    Quote Originally Posted by Tyler-2000
    jmcilhinney,

    Your code was very similiar to mine, but I tried yours and it has the exact same problem. I'm using a custom shape form with transparency(not Regions), could that have something to do with it?
    I'm quite sure it does. The form probably can't be redrawn quickly enough to keep up with the animation. You could try increasing the duration a bit, but I'm not confident that that will make a difference. You could try using the Blend effect instead, so your form behaves like the Outlook new mail notification, although I'm not sure that will make a difference either.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    Re: AnimateWindow Problem

    Making the duration longer helped a little, it made the black bar thinner. The blend effect just goes from black to the form instantly. Then I tried Centre with a duration of 50, and the black area is hardly noticeable so I may keep it that way.

    I'm wondering how fast a PC needs to be to draw a custom form with a slide animation smoothly. My system is a P4 2.4Ghz with a geforce4 128mb.
    Last edited by Tyler-2000; Sep 14th, 2005 at 09:11 AM.

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