Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: pre-select itembox by default
Is there any way to pre-select multiple non-adjacent items? Maybe I could sort my list so that the items I wanted were already adjacent.
Using a dialog callback procedure and a DialogControlSet request code 6 set in the initialization section of the dialog proc. You can set them all that way.
Here is my code:
#DEFINESUBROUTINE PreSetExample(Handle,DialogMessage,DialogControlID,param4,param5) switch (DialogMessage) case 0 IntControl(33,0,0,0,0) DialogControlSet(Handle,003,6,"Grapes") break; endswitch return -1 #ENDSUBROUTINE list = StrCat("Apples",@tab,"Oranges",@tab,"Grapes") MyDialogFormat=`WWWDLGED,6.1` MyDialogCaption=`WIL Dialog 1` MyDialogX=002 MyDialogY=050 MyDialogWidth=208 MyDialogHeight=153 MyDialogNumControls=003 MyDialogProcedure=`PreSetExample` MyDialogFont=`DEFAULT` MyDialogTextColor=`DEFAULT` MyDialogBackground=`DEFAULT,DEFAULT` MyDialog001=`30,129,034,011,PUSHBUTTON,DEFAULT,"OK",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog002=`123,130,033,011,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog003=`001,001,202,116,ITEMBOX,list,DEFAULT,DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("MyDialog") Exit
Moving the IntControl 33, to just before you define the dialog.
#DEFINESUBROUTINE PreSetExample(Handle,DialogMessage,DialogControlID,param4,param5) switch (DialogMessage) case 0 DialogControlSet(Handle,003,6,"Grapes") break; endswitch return -1 #ENDSUBROUTINE IntControl(33,0,0,0,0) ;Notice this IntControl must be used outside the Callback Procedure. list = StrCat("Apples",@tab,"Oranges",@tab,"Grapes") MyDialogFormat=`WWWDLGED,6.1` MyDialogCaption=`WIL Dialog 1` MyDialogX=002 MyDialogY=050 MyDialogWidth=208 MyDialogHeight=153 MyDialogNumControls=003 MyDialogProcedure=`PreSetExample` MyDialogFont=`DEFAULT` MyDialogTextColor=`DEFAULT` MyDialogBackground=`DEFAULT,DEFAULT` MyDialog001=`30,129,034,011,PUSHBUTTON,DEFAULT,"OK",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog002=`123,130,033,011,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog003=`001,001,202,116,ITEMBOX,list,DEFAULT,DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("MyDialog") Exit
Article ID: W15129
File Created: 2002:09:10:07:10:52
Last Updated: 2002:09:10:07:10:52