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 8989783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:20:47+00:00 2026-06-15T22:20:47+00:00

I have this custom class Public Class labelScroll Inherits Label Public Shadows Property Text

  • 0

I have this custom class

Public Class labelScroll
    Inherits Label

    Public Shadows Property Text As String
        Get
            Return MyBase.Text
        End Get
        Set(ByVal value As String)
            Dim add As String = ""
            Dim result As String()
            Dim i As Integer
            result = Split(value, vbLf)
            Dim n As Integer = 30
            If (result.Length < n) Then
                n = result.Length
            End If
            Dim start As Integer = result.Length - n
            For i = start To result.Length - 1 Step 1
                add += result(i) + Environment.NewLine
            Next
            MyBase.Text = add
        End Set
    End Property
End Class

I have a form that I placed this labelScroll on and also placed a button: I have this code for the button’s click event:

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    LabelScroll1.Text = "1"
    Threading.Thread.Sleep(1000)
    LabelScroll1.Text += "2"
    Threading.Thread.Sleep(1000)
    LabelScroll1.Text += "3"
End Sub

What happens when I click the button is that it takes 2 seconds and then just shows “1” “2” “3” on three lines. What actually should happen is that when the user clicks the button, “1” appears and then Threading.Thread.Sleep(1000) is executed so the program waits for 1 second then prints “2” on the next line.

Why isn’t this happening?

  • 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-06-15T22:20:48+00:00Added an answer on June 15, 2026 at 10:20 pm

    Setting the text on a label invalidates the control – meaning it will redraw the next time the event queue is processed (effectively). This won’t happen whilst you’re sleeping on the UI thread – try adding MyBase.Update() immediately after the MyBase.Text = … line to force an immediate update.

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

Sidebar

Related Questions

I have a class with a custom indexer like so public string this[VehicleProperty property]
say, I have a partial class that contains a custom property like this public
I have a custom class: public class Person { public String Name { get;
I have a custom control that inherits from .NET's CompositeControl class. This control overrides
I have my custom class User : class User { public String name; public
I have this custom dialog: public class MyProgressDialog extends Dialog { public MyProgressDialog(Context context)
Suppose I have this model: public class ViewModel { [Required] public string UserInput {
I have this scenario: One custom class (Customer) with some properties, like this: public
I have this custom class ... public class DrawView extends ImageView When I set
I have this custom type: public struct PasswordString { private string value; public PasswordString(string

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.