gpt4 book ai didi

c# - 任务栏中的应用程序标题而不是标题栏

转载 作者:太空宇宙 更新时间:2023-11-03 11:39:07 25 4
gpt4 key购买 nike

这是我做的一件奇怪的事情,但是我怎么能在任务栏中设置 winform 窗体的标题,而不是在它的标题栏中?

最佳答案

一个可能的解决方案(对我来说效果很好)是覆盖 CreateParams 属性并将标题设置为在任务栏中显示:

protected override CreateParams CreateParams
{
get
{
new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();

// Extend the CreateParams property of the Button class.
CreateParams cp = base.CreateParams;
// Update the button Style.
cp.Style &= ~0xC00000; //WS_CAPTION;
cp.Caption = PRODUCT_NAME;

return cp;
}
}

希望对你有用,

丽莎

关于c# - 任务栏中的应用程序标题而不是标题栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5245498/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com