开发者

Region problem when starting cold .net application

开发者 https://www.devze.com 2023-03-14 13:44 出处:网络
I\'m showing a splash screen in my .net application and in my OnLoad override I am setting the Region property to rounded rectangle, so that the splash screen appears to have curved corners.This works

I'm showing a splash screen in my .net application and in my OnLoad override I am setting the Region property to rounded rectangle, so that the splash screen appears to have curved corners. This works brilliantly, except for when the program is started cold; then the area outside the region (in the four corners) tempor开发者_StackOverflow社区arily appears black instead of transparent. Anyone have any ideas on why the cold start may affect the UI layout? Thanks for your time.


Can you set the Region inside the constructor of the Form but after the InitializeComponent? At that point the size of your form will be defined and so you can correctly decide on the Region required. This would define the region before the window handle is created.

If that turns out to be too early then try overriding the OnHandleCreated and do it after calling the base class.

0

精彩评论

暂无评论...
验证码 换一张
取 消