2010-01-18 120 views

回答

5

隐藏要素(能见度=隐藏)直到的WinForms控制满载...

+2

呀,会做它。不过,我不得不隐藏ElementHost。如果我只是将wpf元素放置到可见性=隐藏状态,我仍然有闪光灯。但是,谢谢你指出我正确的方向。 – jostyposty 2010-01-19 13:17:54

+4

在哪一点上,WinForms控件被认为是“完全加载”? – Reddog 2010-12-08 22:14:19

+0

@Reddog - 注册以加载事件 (this.Load + = ....) – Erez 2016-03-16 12:19:21

0

你需要用空界的首秀控制第一时间,以避免黑色闪烁

if (!_control.Created && _control.BackColor != Color.Transparent) 
{ 
    _control.Bounds = Rectangle.Empty; 
    _control.Show(); 
} 

// set control bounds and show it 
Rectangle bounds = GetBounds(context, rect); 
if (_control.Bounds != bounds) 
    _control.Bounds = bounds; 
if (!_control.Visible) 
    _control.Show(); 
+0

您能详细说明一下吗?我很难找出这方面的背景...... – 2015-07-28 16:43:56