如题
------解决方案--------------------
试了试,勉强可以,不过在控件得到焦点后,还需要做进一步的处理,大致如下:
1. 新建一表单,
2. 中间用 Image 控件放一块大图片
3. 再添加一 RichText 控件在图片上
4. 最后加一个按钮,按钮 Click 事件中写入下面的代码:
- VB code
#define GWL_EXSTYLE -20 #define WS_EX_TRANSPARENT 0x20 Declare Long SetWindowLong in win32api Long hwnd, Long nIndex, Long dwNewLong Declare Long GetWindowLong in win32api Long hwnd, Long nIndex Declare Long GetParent in win32api Long hWnd hWnd = Thisform.olecontrol1.hwnd SetWindowLong(hwnd, GWL_EXSTYLE, Bitor(GetWindowLong(hwnd, GWL_EXSTYLE), WS_EX_TRANSPARENT)) hWnd = GetParent(hWnd) SetWindowLong(hwnd, GWL_EXSTYLE, Bitor(GetWindowLong(hwnd, GWL_EXSTYLE), WS_EX_TRANSPARENT)) With Thisform.olecontrol1 .Width = .Width + 1 .Width = .Width - 1 EndWith