Bring Winforms control to front

前端 未结 5 704
刺人心
刺人心 2020-12-03 21:05

Are there any other methods of bringing a control to the front other than control.BringToFront()?

I have series of labels on a user control and when I

5条回答
  •  长情又很酷
    2020-12-03 21:38

    Have you tried Invalidate() after BringToFront()? BringToFront does not raise the Paint event

    try this:

    private void SendLabelsToBack()
    {
        foreach (var label in userContainer.Controls)
        {
            label.SendToBack();
            label.Invalidate();
        }
    }
    

提交回复
热议问题