Put the following code into the on_click action of a button:
Example 5-13. Loading a file content into a field
filename=hk_this.show_filedialog() file=open(filename) data=file.read() datafield=cast_dsmemo(hk_thisform.get_visible("datafield")) datafield.set_value(data)