How to select editbox text when I enable checkbox ?
Dlg.Control("edit1").SelectRange(0, -1) give me error.
[code]<?xml version="1.0"?>
Test
#rename
@script VBScript
Function OnClick(ByRef clickData)
Set Dlg = DOpus.Dlg
Dlg.window = clickData.func.sourcetab
Dlg.template = "Test"
Dlg.detach = True
Dlg.Show
Do
Set Msg = Dlg.GetMsg()
If Msg.event = "click" Then Call CheckboxChecked(Dlg, Msg)
Loop While Msg
End Function
Sub CheckboxChecked(ByRef Dlg, ByRef Msg)
If Msg.control = "check1" Then
If Dlg.Control("check1").value = True Then
Dlg.Control("edit1").enabled = True
Dlg.Control("edit1").focus = True
Dlg.Control("edit1").SelectRange(0, -1)
Else
Dlg.Control("edit1").enabled = False
End If
End If
End Sub
==SCRIPT RESOURCES
<resources>
<resource name="Test" type="dialog">
<dialog fontsize="8" height="61" lang="Francais" standard_buttons="cancel" title="Test" width="150">
<languages>
<language height="130" lang="english" title="Renommage de fichier" width="396" />
</languages>
<control height="10" name="check1" title="Check this" type="check" width="48" x="13" y="17">
<languages>
<language height="10" lang="english" title="Replace" width="64" x="18" y="18" />
</languages>
</control>
<control enable="no" halign="left" height="12" name="edit1" title="select this" type="edit" width="66" x="73" y="16" />
<control close="1" height="14" name="button1" title="OK" type="button" width="50" x="39" y="43" />
</dialog>
</resource>
</resources>
[/code]