zoukankan      html  css  js  c++  java
  • 关于Winform控件调用插入点(光标)的用法

    我们自定义控件中可能会有一些光标的使用,比如插入文字和图片提示,下面是调用WIN32 API的光标用法

    Winform控件调用插入点的用法

     // 导入处理光标的 Windows 32 位 API
            // 创建光标
            [DllImport("User32.dll")]
            private static extern bool GetCaretPos(ref  MyNativePOINT p);
    
    
            // 导入处理光标的 Windows 32 位 API
            // 创建光标
            [DllImport("User32.dll")]
            private static extern bool CreateCaret(IntPtr hWnd, int hBitmap, int nWidth, int nHeight);
            // 设置光标位置
            [DllImport("User32.dll")]
            private static extern bool SetCaretPos(int x, int y);
            // 删除光标
            [DllImport("User32.dll")]
            private static extern bool DestroyCaret();
            // 显示光标
            [DllImport("User32.dll")]
            private static extern bool ShowCaret(IntPtr hWnd);
            // 隐藏光标
            [DllImport("User32.dll")]
            private static extern bool HideCaret(IntPtr hWnd);

     版权所有,请勿转载

  • 相关阅读:
    2017暑期集训Day 1
    17-06-28模拟赛
    17-06-26模拟赛
    平衡树学习笔记
    指针学习笔记
    17-06-14模拟赛
    17-06-11模拟赛
    17-06-02模拟赛
    17-05-31模拟赛
    培训补坑(day1:最短路&two-sat)
  • 原文地址:https://www.cnblogs.com/edangame/p/6039366.html
Copyright © 2011-2022 走看看