三个问题?(好不容易才进来了....)(150分)

  • 主题发起人 主题发起人 jun
  • 开始时间 开始时间
J

jun

Unregistered / Unconfirmed
GUEST, unregistred user!
1. 如何任意转移焦点,或按了button1、BUTTON2、BUTTON3后焦点都到RICHEDIT。<br>2. 在RICHEDIT内 MOUSE对焦点不起作用,(不改变焦点所在行)最好屏蔽MOUSE双键。<br>3. 如何屏蔽虚拟键码表如VK_LEFT 使它在RICHEDIT内无效。
 
1.RICHEDIT.setfoucs<br>2.????<br>3.自己截获鼠标消息
 
1. richedit1.setfocus;<br>2. 请说详细些<br>3.<br>procedure TForm1.RichEdit1KeyDown(Sender: TObject; var Key: Word;<br>&nbsp; Shift: TShiftState);<br>begin<br>&nbsp; if key=vk_left then key:=0;<br>end;<br>
 
cAkk真快,等我回答完,发现你已经回答了。
 
3.www说的对,我没看清题目. :-P
 
2. 要截获WM_NCHITTEST, 来处理吧:-)<br>
 
2.在richedit的mousemove事件中加入:<br>&nbsp; setcapture(self.handle); <br>&nbsp; 在richedit的parent的mousemove事件中加入:<br>&nbsp; releasecapture;<br><br>
 
呵呵, 不行, 那样连上下左右和pgup/down键都不管用了:-(<br>
 
先谢谢各位了!<br>2.在RICHEDIT内MOUSE对光标"|"不能改变所在行,<br>另如何让光标"|"变成"_"?(MS-DOS下光标)<br>此处唯一不足之处,除了慢,还是慢.....(回答问题倒是快!快!快!)<br>20分钟看个问题!真羡慕你们啊!<br>
 
为什么要让光标"|"变成"_"?
 
CreateCaret//创建光标<br>The CreateCaret function creates a new shape for the system caret and assigns ownership of the caret to the specified window. The caret shape can be a line, a block, or a bitmap. <br><br>BOOL CreateCaret(<br>&nbsp; HWND hWnd, &nbsp; &nbsp; &nbsp; &nbsp;// handle to owner window<br>&nbsp; HBITMAP hBitmap, &nbsp;// handle to bitmap for caret shape<br>&nbsp; int nWidth, &nbsp; &nbsp; &nbsp; // caret width<br>&nbsp; int nHeight &nbsp; &nbsp; &nbsp; // caret height<br>);<br>&nbsp;<br>Parameters<br>hWnd <br>Identifies the window that owns the caret. <br>hBitmap <br>Identifies the bitmap that defines the caret shape. If this parameter is NULL, the caret is solid. If this parameter is (HBITMAP) 1, the caret is gray. If this parameter is a bitmap handle, the caret is the specified bitmap. The bitmap handle must have been created by theCreateBitmap,CreateDIBitmap, orLoadBitmap function. <br>If hBitmap is a bitmap handle, CreateCaret ignores the nWidth and nHeight parameters; the bitmap defines its own width and height. <br><br>nWidth <br>Specifies the width of the caret in logical units. If this parameter is zero, the width is set to the system-defined window border width. If hBitmap is a bitmap handle, CreateCaret ignores this parameter. <br>nHeight <br>Specifies the height, in logical units, of the caret. If this parameter is zero, the height is set to the system-defined window border height. If hBitmap is a bitmap handle, CreateCaret ignores this parameter. <br>Return Values<br>If the function succeeds, the return value is nonzero.<br><br>If the function fails, the return value is zero. To get extended error information, callGetLastError. <br><br>Remarks<br>The nWidth and nHeight parameters specify the caret's width and height, in logical units; the exact width and height, in pixels, depend on the window's mapping mode. <br><br>CreateCaret automatically destroys the previous caret shape, if any, regardless of the window that owns the caret. The caret is hidden until the application calls the ShowCaret function to make the caret visible. <br><br>The system provides one caret per queue. A window should create a caret only when it has the keyboard focus or is active. The window should destroy the caret before losing the keyboard focus or becoming inactive. <br><br>You can retrieve the width or height of the system's window border by using the GetSystemMetrics function, specifying the SM_CXBORDER and SM_CYBORDER values. Using the window border width or height guarantees that the caret will be visible on a high-resolution screen. <br>
 
就这样吧!<br>谢谢各位!<br>请问一下能和各位用邮件交流吗?<br>太慢了!发分都很慢...
 
后退
顶部