Tuto WINDEV 25
Part 2: The WLanguage basics 79 7. Display the next wizard step: give a name (COMBO_VAT) and a caption (VAT) to the control. 8. Validate. ▶ To create the "Calculate" Button control: 1. On the "Creation" pane, in the "Usual controls" group, click . 2. Click the location where the control will be created (below the Combo Box control for example). 3. Click the control that was just created. The text displayed in the control becomes editable. Type the caption: "Calculate". 4. Press Enter to validate the input. ▶ The amount IOT will be calculated via the code of the "Calculate" Button control. 1. Display the code of "Calculate" control ("Code" from the popup menu). 2. Write the following WLanguage code in the "Click BTN_Calculate" event: SWITCH COMBO_VAT..DisplayedValue // 5.5 % CASE 5.5 EDT_PriceIOT = EDT_PriceBT * 1.055 // 10 % CASE 10 EDT_PriceIOT = EDT_PriceBT * 1.1 // 20 % CASE 20 EDT_PriceIOT = EDT_PriceBT * 1.2 END This code calculates the amount IOT by using the value selected in the Combo Box control (returned by ..DisplayedValue ).
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==