How to change the written content of a combo edit

Greetings.
How would be the correct way to modify the actual content written in a combo edit? I don't want to add a new item to the control, I just want to change what is currently written. I've tried using DialogListItem.name, but it gives error.
A script to help better understand my question.

function OnInit(initData) {
	initData.name = "dlg_test";
	initData.version = "1.0";
	initData.copyright = "";
	initData.desc = "";
	initData.default_enable = true;
	initData.min_version = "13.0";

}

// Called to add commands to Opus
function OnAddCommands(addCmdData) {
	var cmd = addCmdData.AddCommand();
	cmd.name = "dlg_test";
	cmd.method = "Ondlg_test";
	cmd.desc = "";
	cmd.label = "dlg_test";
	cmd.template = "";
	cmd.hide = false;
	cmd.icon = "script";
}

// Implement the dlg_test command
function Ondlg_test(scriptCmdData) {
	var parent = scriptCmdData.func.sourcetab.lister;
	var dlg = parent.dlg();
	dlg.template = 'dialog1';
	dlg.disable_window = parent;
	dlg.detach = true;
	dlg.Show();
	var msg;
	while (true) {
		msg = dlg.GetMsg();
		if (!msg.result) break;
		if (msg.event === 'click' && msg.control === 'button1') { //change comboedit value
			if (dlg.Control('combo1').value.index === -1) {
				//???? 
			}
			else dlg.Control('combo1').value.name = 'changed!'; //Error 0x80004005 if used while index == -1
		}
	}
	return;
}

dlg_test.opusscriptinstall (1.1 KB)

Thanks!

The control.label property can be used for that with editable combos:

dlg.Control('combo1').label = "Hello World";
1 Like