Create a New Form then switch to code view. Paste the following code replacing what is currently in the code window.
Take a note of the code line SetGadgetState(Combo_0,1) in the OpenWindow_0() Procedure
Now goto the Form Menu and switch back Form view and then switch back to code view and you will notice that the SetGadgetState code line is no longer in the code. ie switching views deletes the code line.
Code: Select all
Global Window_0
Global Combo_0
Procedure OpenWindow_0()
Window_0 = OpenWindow(#PB_Any, 0, 0, 310, 120, "", #PB_Window_SystemMenu)
Combo_0 = ComboBoxGadget(#PB_Any, 40, 14, 100, 25, #PB_ComboBox_UpperCase)
AddGadgetItem(Combo_0, -1, "N")
AddGadgetItem(Combo_0, -1, "S")
SetGadgetState(Combo_0,1)
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure