I'm completely stuck and if possible for someone to complete the code of the program for meWhat help are you actually asking for?
Thanks for the suggestion, I'll edit the layoutYou really need to name your controls properly.
Don't use the TextChanged event or you are going to get into trouble really quickly. Use a button somewhere call it calculate and use that to run the calculations.
How do I do that?You could put the controls into a frame and then disabling the frame locks the controls. Or you could disable them individually remembering to re enable them when the user clicks on the No.
Good thinking, what would be the best way to do it?Yes, but you wouldn't want to. What happens if they accidently click on No and change their mind? You've just disabled the control with no way of putting it back.
Thanks, I'll change them to LabelsText boxes are for data collection. You can disable them, but they go grey.
For displaying information like costs, turn them into Labels.
I've thought about it and have gone with your decision, I've changed it to one section with ComboBox,As I said before I'd have the collect option in a drop down list with all the other delivery options. However if you want to stick with one set of options for collection/delivery and one for delivery code then I would use the click event of each of the collection/delivery radio controls to change whether you can click on the delivery code controls. It might even be a good idea to clear the selected delivery option if they select collection.
I've changed the Delivery option to ComboBox with selection,Sorry, I kind of forgot about this thread.
How far have you got now?
The labels display the costs correctly, but without currency, I want to add £ sign before the number in the Label, but I don't know howIt's just text. Put in what you want.
You want to construct a string with the currency symbol and cost and the set the label text to that; for example -
Do I add the string code to the Label or the textbox above?Code:Label.text = "currency-symbol" & intCost
Where do I add the string code?Personally I'd have
label.text = "£" & fCost.toString
or
label.text = string.concat("£",fCost.toString)
or
dim sb as New System.Text.stringbuilder
sb.append("£")
sb.append(fCost.toString)
label.text = sb.toString
I tried to code it but when I run it, it says there are problemsYou don't appear to have got any further with this since the 3rd or even tried to do any more.
This is my first practise to code in Visual Basic, I was hoping to get it all coded done so I can see the example for my next practiseAre actually trying to learn this or do you just want the answer? If so I can send you an exe for you to run.
I've sent you the program via Trust
Thanks, I'll alter the code, but is it possible for you to help me finish the coding of Delivery and Calculate part so I can use this program as a example for my next practise pleaseYou might want to read up on basic programming principles. Maybe start with a few Hello World! programs with online code.
To make the text on a label change you reference it and set it's text property to a string value.
in the examples above:
Label1 is the object on the screen that you are trying to affect. Yours is lblMealCost or something.
.text is the property of the object that you are trying to change.
= is assigning the value on the right of it to the property on the left.
"£" is a string value in this case a pound sign.
& is a for concatenation of strings.
fCost is a variable that contains the price that the calculation routing sets so 2.50 etc.
.toString() is a method of the object (in this case a float containing 2.50) which make the number into a string.
so you end up with
Label1.text = "£" & fCost.toString
This replaces whatever line currently set the value of the label you said is displaying the costs. remember to change the label object and the float object to match your code.
I'll have a look at the tutorials