Set cursor position in Dialog System

I have an alphanumeric entry field which I am populating before displaying my dialog screen and would like to set the cursor position at the end. For example, if I populate an entry field in my Visual Cobol program with the word "TESTING"  prior to displaying my screen, I would like the blinking cursor to appear at the end of the word (which would be after the letter "G") once my screen displays.  I do not know how to do this.


Thanks in advanced for your help.

  • I don't think you can do this with a normal entry field except by turning autoswipe on but you can when using the Text Entry control which is found under the Programmable controls tab of Dialog System. These are significantly more difficult to use however as it requires a control program and knowledge of both the native OO programming model and the use of the GUI Class Library.

    There is an example of using this control in the Samples Browser. Select Show Dialog System only from the drop down and then highlight Dialog System Classic and open up the project for Dialog System Text Entry Control.

    You can position the cursor to the end of the field by invoking the methods getText to return the current contents and then counting the characters and then positioning the cursor using the method setSelectionArea.

    FYI, Dialog System is a very old technology that was available with Net Express. It was added to Visual COBOL only for compatibility with existing applications. Doing new development from scratch with Dialog System is not recommended. You should look at some of the managed code solutions available to you such as Windows Forms or WPF.