Here's a simple version to get you going:
You can use SetGadgetFilter for controlling the data being entered into the textfields. I'll try and knock something up to show you how.
' Listbox help for dalaware SuperStrict Local MyWindow:TGadget=CreateWindow(" My Tool Box V1.0", 350,120,400,400) 'the position of the toolbox in the mainwindow Local ListBox:TGadget=CreateListBox(50,50,290,20,MyWindow) 'the size of the listbox inside the toolbox window Local Label0:TGadget=CreateLabel("Working out Percentages",135,5,300,20,MyWindow) ' write text to te Main ToolBox window AddGadgetItem ListBox, " Formular : Value / by 100 x the percent your looking for" ' create a listbox and put text in to it Global Label1:TGadget=CreateLabel("Enter Value :",50,113,70,25,MyWindow) ' write text to te Main ToolBox window Local MyInput_1:TGadget=CreateTextField(135,110,85,20,MyWindow) ' a sort of Input Global Label_2:TGadget=CreateLabel("Enter Percent %:",50,173,85,20,MyWindow) ' write text to te Main ToolBox window Local MyInput_2:TGadget=CreateTextField(135,170,85,20,MyWindow) ' a sort of Input Global Label_3:TGadget=CreateLabel("The result is :",50,233,85,20,MyWindow) ' write text to te Main ToolBox window Local MyInput_3:TGadget=CreateTextField(135,230,85,20,MyWindow) ' a sort of Input 'Global Label1:TGadget=CreateLabel("Enter Value :",50,113,70,25,MyWindow) Repeat WaitEvent() ''Print CurrentEvent.ToString() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETACTION Local v:Float=Float(TextFieldText(MyInput_1)) Local p:Int=Int(TextFieldText(MyInput_2)) SetGadgetText MyInput_3 , v/100.0*p End Select Forever
You can use SetGadgetFilter for controlling the data being entered into the textfields. I'll try and knock something up to show you how.