Post by jarychk on Jul 23, 2024 0:06:43 GMT
I know I was given help on something like this before. I thought I could logically think through this but this fails. I simply have a program (very small right now) with a combobox and I want user to be able to add one more item to the array and then the program reload the combobox. What am I doing wrong or failing to understand?
Program allows me to give a new item name to put into the array and for the combobox, but the new item is never shown in the combobox; even when mouse pulldown.
WAIT! I MAYBE FOUND THE PROBLEM...
So nevermind. Problem was, the "#" for the handle of the combobox was omitted. Now fixed on the program on this computer, but not fixed here in the sample code of the forum.
dim bnm$(200)
'start with three blades
bnm$(1)="g s b"
bnm$(2)="d n p st"
bnm$(3)="bic"
'
ib=3
nomainwin
WindowWidth = 550
WindowHeight = 410
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
button #cutrs.addb, "add a blade", [addb], UL, 30, 61, 122, 25
button #cutrs.remob, "remove a blade", [remob], UL, 30, 106, 122, 25
combobox #cutrs.bnmlist, bnm$(, [bnmlist], 190, 61, 272, 290
open "study add and remove with combobox" for window as #cutrs
print #cutrs, "trapclose [quit.cutrs]"
print #cutrs, "font ms_sans_serif 10"
wait
[quit.cutrs]
Close #cutrs
END
[addb] 'Perform action for the button named 'addb'
notice "You'll be asked for full bnm name, and th.."
prompt "Complete bnm product name";bldin$
if bldin$="" then
wait
end if
'
ib=ib+1
bnm$(ib)=bldin$
print cutrs.bnmlist,"reload"
wait
[remob] 'Perform action for the button named 'remob'
'Insert your own code here
wait
[bnmlist] 'Perform action for the combobox named 'bnmlist'
'Insert your own code here
wait
Program allows me to give a new item name to put into the array and for the combobox, but the new item is never shown in the combobox; even when mouse pulldown.
WAIT! I MAYBE FOUND THE PROBLEM...
So nevermind. Problem was, the "#" for the handle of the combobox was omitted. Now fixed on the program on this computer, but not fixed here in the sample code of the forum.