Updating edit box in a dialog

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
lcrltd
Junior Coder
Posts: 35
Joined: Thu Nov 16, 2006 8:23 am

Updating edit box in a dialog

Post by lcrltd » Tue Jun 26, 2007 7:22 pm

Hi all ,
Iam trying to run a dialog with an edit box that gets updated via button pressed on the dialog screen.
Example , I have an edit box called Time Done, when I press a button on the screen called GET FILES I wish it to update the Time Done edit box with the current time.

My issue is that whatever is in the edit box when the dialog opens , stays there and can not be updated -on the fly-

Is there a command to refresh the dialog window to refresh the variables that feed the edit box?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jun 26, 2007 8:23 pm

This sample demonstrates how to change several dialog objects. It will change a label, an edit box, a button, a combobox and a listbox. There are two things to know, one is the name of the item to be changed which I usually acquire by creating the dialog then adding a Show> line to the script. I then step through those few lines in the editor by pressing F8. After that if you look at the info in the watchlist you'll see the names of the variables to change. The second thing is that most of these won't change until after you run ResetDialogAction>.

Code: Select all

Dialog>Dialog1
   Caption=Dialog1
   Width=369
   Height=197
   Top=368
   Left=432
   Label=msLabel1,32,24
   Edit=msEdit1,32,48,121,
   Button=Display,32,80,75,25,0
   ComboBox=msComboBox1,208,24,121,
   ListBox=msListBox1,208,56,121,49,
   Button=Process,152,128,75,25,3
   Default=Process
EndDialog>Dialog1

Show>dialog1

Label>start
GetDialogAction>dialog1,r1
If>r1=3,Process
If>r1=2,EOF

Goto>start

Label>EOF

SRT>Process
  GetTime>time
  Let>dialog1.mslabel0=%time%
  Let>dialog1.msedit1=%time%
  Let>dialog1.msbutton2=%time%
  Let>dialog1.mscombobox1.items.text=%time%
  Let>dialog1.mslistbox1.items.text=%time%
  ResetDialogAction>dialog1
END>Process


lcrltd
Junior Coder
Posts: 35
Joined: Thu Nov 16, 2006 8:23 am

Post by lcrltd » Wed Jun 27, 2007 3:40 pm

Thats perfect, thank you very much.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts