How to set in dropdownlist?


#1

Hello, I have noob question.
I want set the “v5” after select “Xmesh” and press Sync. But I don’t know how to write for list items to set v5 in dropdownlist…
thank you.

try (destroydialog dialog) catch()
rollout dialog "test" width:150
(

	button btn "OK" 
	button btn2 "Sync"
	dropdownlist list items:#(#v1,#v2,#v3,#v4,#v5)
	dropdownList list_type "Type"width:110 height:40 items:#("Tyflow","Xmesh","Fume")
	
	
	on list_type selected index do
	(
		m = index
		list_type.items[m]
    )
	
	on  btn2 pressed do
	(
		if 	m == 2 do
		(
		list.items == 5 -- I do not know hot to set this
		)
    )
	
)
createdialog dialog

#2
try (destroydialog dialog) catch()
rollout dialog "test" width:150
(
	local type = 1
	
	button btn "OK" 
	button btn2 "Sync"
	dropdownlist list items:#(#v1,#v2,#v3,#v4,#v5)
	dropdownList list_type "Type"width:110 height:40 items:#("Tyflow","Xmesh","Fume")
	
	
	on list_type selected index do
	(
		type = index
    )
	
	on  btn2 pressed do
	(
		if 	type == 2 do
		(
			list.selection = 5
		)
    )
	
)
createdialog dialog

#3

Thanks for your kindness!! :slight_smile:
It worked!