IgnaceMaes / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
2.84k stars 829 forks source link

Style messes up on using delegates #162

Open crimson-med opened 7 years ago

crimson-med commented 7 years ago

I am running some threads on the side of the main thread to search for files with GetFiles() and I want to show the paths of scanned files so I have a simple delegate:

  Delegate Sub SetLabelTextInvoker(ByVal TextToDisplay As String)
    Public Sub SetLabelText(ByVal TextToDisplay As String)
        If MaterialLabel1.InvokeRequired Then
            MaterialLabel1.Invoke(New SetLabelTextInvoker(AddressOf SetLabelText), New Object() {TextToDisplay})
        Else
            MaterialLabel1.Text = TextToDisplay
        End If
    End Sub

Example of the render after a while: render

hadi77ir commented 6 years ago

This project heavily relies on the Paint event. I think you should force the form to redraw by invalidating.