小编Met*_*dja的帖子

在Windows应用商店应用中更改光标

我正在用C#制作一个Windows应用商店应用,我有一个普通的TextBlock,里面有一个链接.所有我想要做的就是当光标越过文本块时将光标变为手形,但与WPF应用程序不同,没有Cursor适当性.我知道是一个CoreCursorWindows.UI.Core.我想以某种方式使用它吗?

c# cursor windows-8 windows-runtime winrt-xaml

15
推荐指数
1
解决办法
9222
查看次数

List <T> Metro应用程序中的.Find方法

我想知道List<T>.Find在C#中创建Metro应用程序时为什么不可用.它仍然在.NET Framework 4.5(Windows窗体,WPF)中,但在Metro风格的应用程序中却没有.有替代方案还是不存在查找方法?

.net c# microsoft-metro windows-runtime

4
推荐指数
1
解决办法
330
查看次数

用F#扩展航空玻璃(PInvoke)

我正在研究一个F#控制台应用程序.在属性中,我将应用程序的输出类型设置为Windows应用程序以隐藏控制台.我还创建了一个在其位置运行的表单.目前我只有一个没有控件的简单表单.为了使形式我添加referances到System.Windows.FormsSystem.Drawing把包裹打开一起System.Runtime.InteropServices.

我不知道怎么做的部分是扩展航空玻璃.如何在C#中做到这一点有很多问题.例如,这是API调用和MARGINS结构:

[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
    public int cxLeftWidth;
    public int cxRightWidth;
    public int cyTopHeight;
    public int cyBottomHeight;
}
[DllImport("dwmapi.dll")]
pubic static extend int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);
Run Code Online (Sandbox Code Playgroud)

来自Form_Load事件的API调用:

MARGINS margins = new MARGINS();
margins.cxLeftWidth = 0;
margins.cxRightWidth = 100;
margins.cyTopHeight = 0;
margins.cyBottomHeight = 0;
int result = DwmExtendFrameIntoClientArea(this.Handle, ref margins);
Run Code Online (Sandbox Code Playgroud)

这是我到目前为止在F#中得到的:

API调用和MARGINS结构:

[<StructLayout(LayoutKind.Sequential)>]
type MARGINS =
    struct
        val cxLeftWidth : int
        val cxRightWidth : int
        val cyTopHeight : …
Run Code Online (Sandbox Code Playgroud)

pinvoke f# dllimport

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