Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1101389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:01:40+00:00 2026-05-17T01:01:40+00:00

I have a custom control’s library. Now there’s a control which looks like a

  • 0

I have a custom control’s library. Now there’s a control which looks like a panel, and when it opens up I want to animate its vertical growing like this:

For h As Single = 0 To finalHeight Step 0.5
    Me.Height = CInt(h)
    '  HERE I WANT TO CALL DoEvents'
Next
Me.Height = finalHeight 

If I don’t call DoEvents in the loop then the animation is not shown, I only get the final height without a visual feedback along the way.

I can call DoEvents from inside my main WinForm project, but can’t inside a library.

How can I do that, without drowning into the deep threads waters?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:01:40+00:00Added an answer on May 17, 2026 at 1:01 am

    This is what I’ve found: the timer, even at fast intervals, it is really slow. I don’t know why but the animation is very jumpy with the timer. Simplified code:

     rolex = New Timer()
     rolex.Interval = 150
     AddHandler rolex.Tick,
                Sub(sender As Object, e As EventArgs)
    
                    Me.Height += 5
    
                    If Me.Height < finalHeight Then Exit Sub
    
                    rolex.Stop()
                    rolex = Nothing
    
                    Me.Height = finalHeight 
                End Sub
     rolex.Start()
    

    Without the timer I use a loop:

    For i As Single = 0 To finalHeight Step 0.5
                Height = CInt(i)
                Application.DoEvents()
    Next
    Height = finalHeight 
    

    It works now, but the problem is that the animation speed too much depends on the machine where the loop is executed. For this reason I’d like to use a Timer, but as I said it’s too slow.

    Any hints?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom control which inherits from System.Web.UI.Control and some of its properties
I have custom control like tabbar which displays many controllers some of them also
I have a custom control which is supposed to work like the Segmenttab controller
I have a custom control which displays results of some operations. It is hidden
I have a custom control (C#, visual studio). I want to show a tooltip
I have a custom control/view that observes the direction of a gesture within its
I have a custom control whose primary purpose is to draw data. I want
I have a custom control which has a property of type Collection<System.Drawing.Point> . When
I have a custom Control which contains the generic.xaml inside the Themes folder. I
I have a custom control template which is set via the style property on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.