作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我遇到错误的代码块:
public static bool Flash(Form form)
{
return (Win2000OrLater && FlashWindowEx(ref Create_FLASHWINFO(form.Handle, 15, uint.MaxValue, 0))); //A ref or out argument must be an assignable variable
}
public static bool Flash(Form form, uint count)
{
return (Win2000OrLater && FlashWindowEx(ref Create_FLASHWINFO(form.Handle, 3, count, 0))); //A ref or out argument must be an assignable variable
}
private static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
public static bool Start(Form form)
{
return (Win2000OrLater && FlashWindowEx(ref Create_FLASHWINFO(form.Handle, 3, uint.MaxValue, 0))); //A ref or out argument must be an assignable variable
}
public static bool Stop(Form form)
{
return (Win2000OrLater && FlashWindowEx(ref Create_FLASHWINFO(form.Handle, 0, uint.MaxValue, 0))); //A ref or out argument must be an assignable variable
}
private static bool Win2000OrLater
{
get
{
return (Environment.OSVersion.Version.Major >= 5);
}
}
A ref or out argument must be an assignable
最佳答案
关于您的第一个错误,您需要将 FlashWindow 作为变量引入,例如
这:
public static bool Flash(Form form)
{
return (Win2000OrLater && FlashWindowEx(ref Create_FLASHWINFO(form.Handle, 15, uint.MaxValue, 0))); //A ref or out argument must be an assignable variable
}
public static bool Flash(Form form)
{
if (Win2000OrLater)
{
FLASHWINFO fi = Create_FLASHWINFO(form.Handle, 15, uint.MaxValue, 0);
return (FlashWindowEx(ref fi));
}
return false;
}
关于c# - 帮助修复 C# "A ref or out argument must be an assignable"中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7307705/
我是一名优秀的程序员,十分优秀!