Initialize the OCX control
When you run your application, the u_ter object may not fully initialize to the point of gaining focus and displaying a cursor. The setfocus() function of PowerBuilder will not perform this function. Place the following code in the Activate event of the window containing your u_ter object to simulate a user mouse click. This will make sure that the TER object has proper focus when your window opens.
// #define WM_LBUTTONDOWN 0x0201, = 513
post send( ole_rtext.il_hWnd, 513, 0, 0 )
// #define WM_LBUTTONUP 0x0202, = 514
post send( ole_rtext.il_hWnd, 514, 0, 0 )
If you place u_ter on a sheet window, you will need to resize the window to the size of the sheet. When you design the sheet window, position the u_ter object in the extreme upper left hand corner of the sheet. Then, place the following code in the resize event of the sheet window.
int li_ret
li_ret = u_ter.resize( WorkSpaceWidth() - 10, WorkSpaceHeight() - 10