正个目地是这个的我想先求出 输入光标的 行和列
再然求出最后被输入的单词
和 光标 在 RichTextBox 上的 X,Y 坐标
就这三个目地…谢谢啦

解决方案 »

  1.   

    第一个问题应该准确无误地回答过了。第三个问题也是。获得任何位置的单词,参考(Platform SDK Feb, 2001):EM_CHARFROMPOSThe EM_CHARFROMPOS message retrieves information about the character closest to a specified point in the client area of an edit control. You can send this message to either an edit control or a rich edit control.To send this message, call the SendMessage function with the following parameters. SendMessage( 
      (HWND) hWnd,              // handle to destination window 
      EM_CHARFROMPOS,           // message to send
      (WPARAM) wParam,          // not used; must be zero
      (LPARAM) lParam          // point coordinates
    );
    Parameters
    wParam 
    This parameter is not used. 
    lParam 
    Specifies the coordinates of a point in the control's client area. The coordinates are in screen units and are relative to the upper-left corner of the control's client area. 
    Rich edit controls: This is a pointer to a POINTL structure that contains the horizontal and vertical coordinates. Edit controls: The low-order word contains the horizontal coordinate. The high-order word contains the vertical coordinate. Return Values
    Rich edit controls: The return value specifies the zero-based character index of the character nearest the specified point. The return value indicates the last character in the edit control if the specified point is beyond the last character in the control. Edit controls: The low-order word specifies the zero-based index of the character nearest the specified point. This index is relative to the beginning of the control, not the beginning of the line. If the specified point is beyond the last character in the edit control, the return value indicates the last character in the control. The high-order word specifies the zero-based index of the line that contains the character. For single-line edit controls, this value is zero. The index indicates the line delimiter if the specified point is beyond the last visible character in a line. Res
    Rich Edit: For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls. Requirements 
      Windows NT/2000 or later: Requires Windows NT 4.0 or later.
      Windows 95/98/Me: Requires Windows 95 or later.
      Version: Requires Rich Edit 1.0 or later.
      Header: Declared in Winuser.h; include Windows.h.See Also
    Edit Controls Overview, Edit Control Messages, EM_POSFROMCHAR, MAKELPARAM, POINTL Microsoft Platform SDK, February 2001 Edition.
    This content last built on Thursday, February 01, 2001.
     Requirements 
      Windows NT/2000 or later: Requires Windows NT 4.0 or later.
      Windows 95/98/Me: Requires Windows 95 or later.
      Version: Requires Rich Edit 1.0 or later.
      Header: Declared in Winuser.h; include Windows.h.
    See Also
    Edit Controls Overview, Edit Control Messages, EM_POSFROMCHAR, MAKELPARAM, POINTL 
      

  2.   

    谁能帮帮我啊!
    我是要求出 输入光标("I") 在 RichTextBox 上的 X,Y 坐标!!!
      

  3.   

    Private Declare Function GetCaretPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Sub Timer1_Timer()
        Dim pt As POINTAIP
        
        GetCaretPos pt
        Label1.Caption = pt.x & "," & pt.y
    End SubGetCaretPos 获得当前活动插入点的坐标。