当前位置: 代码迷 >> C# >> 关于C# 继承Control 绘制TextBox有关问题
  详细解决方案

关于C# 继承Control 绘制TextBox有关问题

热度:219   发布时间:2016-05-05 02:46:55.0
关于C# 继承Control 绘制TextBox问题
在自绘文本框的时候怎么写当鼠标点击到文本框的时候获得光标在所画的矩形框里边!
------解决思路----------------------

HCURSOR CreateCursor(
  HINSTANCE hInst,         // handle to application instance
  int xHotSpot,            // x coordinate of hot spot
  int yHotSpot,            // y coordinate of hot spot
  int nWidth,              // cursor width
  int nHeight,             // cursor height
  CONST VOID *pvANDPlane,  // AND mask array
  CONST VOID *pvXORPlane   // XOR mask array);

BOOL ShowCaret(
  HWND hWnd
   // handle to window with caret
);

BOOL SetCaretPos(
  int X,  // horizontal position 
  int Y   // vertical position
);

------解决思路----------------------
你自绘的文本框没有位置和宽高的属性吗
判断鼠标点击的坐标是否在文本框内部不就是个if语句的问题吗
  相关解决方案