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 that contains 6 panel controls that act like containers
I have a custom control in which I add checkboxes. I want to rearrange
I have a custom user control with a textbox on it and I'd like
I have custom control where i want to show some items. In generic.xaml defined
I have a custom control which contains a list of objects. The control is
I have a custom control with bindings like below <DataTemplate DataType={x:Type vm:EditorTabViewModel}> <me:MarkdownEditor Options={Binding
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have a custom control that inherits from WebControl and implements IValidator, but I
I have a custom control that exposes a property. When I set it using
I have a custom control that has the following prototype. Type.registerNamespace('Demo'); Demo.CustomTextBox = function(element)

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.