小编fac*_*m42的帖子

鼠标结束时更改按钮的颜色

我想在IsMouseOver == True时更改按钮的背景颜色

    <Button Command="{Binding ClickRectangleColorCommand}" Background="{Binding Color, Converter={StaticResource RGBCtoBrushColorsConverter},Mode=TwoWay}" Width="auto" Height="40">
        <TextBlock Foreground="Black" Text="{Binding Color, Converter={StaticResource RGBCColorToTextConveter},Mode=TwoWay}"/>
          <Button.Style>
             <Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
               <Style.Triggers>
                  <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="DarkGoldenrod"/>
                  </Trigger>
               </Style.Triggers>
             </Style>
         </Button.Style>
    </Button>
Run Code Online (Sandbox Code Playgroud)

我似乎无法理解为什么这个触发器不起作用.

wpf user-interface xaml mouseover button

53
推荐指数
3
解决办法
12万
查看次数

杀死应用程序实例的最佳方法

杀死应用程序实例的最佳方法是什么?我知道这三种方法:

Application.Exit()

Environment.Exit(0)

Process.GetCurrentProcess(),杀()

任何人都可以告诉我哪个更好或何时使用上述每个都适合?

c# process winforms

14
推荐指数
1
解决办法
3万
查看次数

致命:无法读取“https://OrganizationName@dev.azure.com”的密码:终端提示已禁用

使用 Azure Pipelines PowerShell 任务构建时,我试图将develop分支合并到分支master

但是在执行命令时git push,我收到此错误:

致命:无法读取“ https://OrganizationName@dev.azure.com ”的密码:终端提示已禁用

代码存储库是“Azure Repos Git”。

git checkout -b master
git config --global user.email "xxxxxxx@xxxx.xxx"
git config --global user.name "xxxxx"
git merge origin/develop 
git push origin master
Run Code Online (Sandbox Code Playgroud)

在引用了一些 URL 之后,我创建了个人访问令牌,并将推送命令修改为git push https://PAT@dev.azure.com/OrganizationName,但它仍然无法正常工作。

如果您找到解决此问题的方法,请告诉我。

git azure-powershell azure-devops azure-pipelines-build-task azure-pipelines

14
推荐指数
2
解决办法
2万
查看次数

发送/接收消息到/从两个运行的应用程序

我有两个名为SENDER和RECEIVER的应用程序.

RECEIVER将由SENDER以System.Diagnostics.Process.Start对象发布

RECEIVER将以隐藏模式启动,因此它没有MainWindowHandle.

然后我们无法使用Win32.WM_COPYDATA顺序发送消息给RECEIVER,因为它需要MainWindowHandle.

我需要的是通过任何方法定期发送和接收消息的能力.

我检查了以下链接的手册,MainWindowHandle但它没有帮助:

将消息发送到Windows进程(而不是其主窗口)

一个解决方案可能是一个有用的对象,System.Diagnostics.Process可以帮助我们将消息发送到进程.

c# message

9
推荐指数
1
解决办法
2万
查看次数

如何刷新/重新加载桌面

我有一个WPF C#项目,我正在实现Windows文件夹选项的设置.其中之一是"单击以打开项目"(而不是双击).当我更改注册表项时,我需要刷新我找到解决方案的Windows资源管理器.但桌面不刷新,甚至手动刷新它不会应用更改.我使用过IActiveDesktop :: ApplyChanges方法,但没有用(或者我犯了一个错误).我也使用过这段代码片段,但它仍然没有应用我所做的更改:

SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
Run Code Online (Sandbox Code Playgroud)

这里是我用来刷新Win Explorer的完整代码片段(女巫来自这个网站):

[System.Runtime.InteropServices.DllImport("Shell32.dll")]
    private static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);

    public static void RefreshWindowsExplorer()
    {
        // Refresh the desktop
        SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);

        // Refresh any open explorer windows
        // based on http://stackoverflow.com/questions/2488727/refresh-windows-explorer-in-win7
        Guid CLSID_ShellApplication = new Guid("13709620-C279-11CE-A49E-444553540000");
        Type shellApplicationType = Type.GetTypeFromCLSID(CLSID_ShellApplication, true);

        object shellApplication = Activator.CreateInstance(shellApplicationType);
        object windows = shellApplicationType.InvokeMember("Windows", System.Reflection.BindingFlags.InvokeMethod, null, shellApplication, new object[] { });

        Type windowsType = windows.GetType();
        object count = windowsType.InvokeMember("Count", System.Reflection.BindingFlags.GetProperty, …
Run Code Online (Sandbox Code Playgroud)

c# wpf desktop

9
推荐指数
1
解决办法
7616
查看次数

单击按钮打开窗口作为模式对话框使用javascript

我必须使用javascript打开单击按钮的窗口作为模式对话框.我使用了window.open,但它显示了两个实例父页面以及弹出页面.当弹出页面打开时,不允许单击父页面.

function openWindow() {
  var w = 950;
  var h = 350;
  var t = 0;
  var l = 0;
  var scrollbars = 1;
  var modal = 'yes';

  var reportWindow = window.open("Search.aspx" + '', '', "width=" + w + ",height=" + h + ",left=" + l + ",top=" + t + ',scrollbars=' + scrollbars + 'modal' + modal);
  reportWindow.focus();
}
Run Code Online (Sandbox Code Playgroud)

html javascript asp.net

2
推荐指数
1
解决办法
2万
查看次数

从一个元素到另一个元素绘制一条线

我想画一条可以设置样式的线,从一个<td>元素的中心位置开始,到另一个<td>元素的中心位置结束。


我已经尝试过使用jQuery Connections 插件,但它连接元素的边缘,而不是中心位置。

这个插件的工作原理如下:

$('#start').connections({
  to: '#end',
  'class': 'related'
});
Run Code Online (Sandbox Code Playgroud)

我希望它以同样的方式工作。(或类似的方式)


另外,当我使用jQuery Connections 插件时,连接线显然不会出现。

html javascript jquery dom shapes

0
推荐指数
1
解决办法
1800
查看次数