[2005] Label.text and Background Image Help
Hey if anyone could help me out with a few problems it would be appreciated.
1. Are you able to make a label.text to certain decimal places? If yes how?
If have a program that + .2 each time and it is only displayed in the label when i reaches 1.
2. I have a button and when clicked i want to change the background image. I know you are meant to use.
Code:
me.backgroundimage = (location)
. But am i able to select an image from my resource folder, without having to use location (C:\....)
Thanks.
Re: [2005] Label.text and Background Image Help
1. A Label simply displays whatever text you provide it. What text are you providing it? Presumably it's coming from a number, but what type of number? If it's an Integer then it will be rounded as Integers can't have decimal places. If it's a Double then it will display its decimal places by default.
2. You don't display anything from your resources folder. The whole point of resources is that they are compiled into your executable. If you've added these images to your project on the Resources tab of the project properties, as you should in 2005, then you access them simply by getting the appropriate property of the My.Resources object.
Re: [2005] Label.text and Background Image Help
Thanks for the help, the my.resources works perfectly.
Ok for the label issue this is what i have.
When a button is clicked:
Label1.text = 1.00 * 16.00 \ 100
The result of this calculations is .16
This will not be displayed in the label
I tried doing Cdbl(label1.text)
But you cannot do this.
Hope this makes sense.
Another quick question. How do i make it when a user clicks the X on a form all the forms close not only just that form?
Thanks
Re: [2005] Label.text and Background Image Help
No, the result of this:is NOT 0.16. The result of that is an Integer containing the value zero. The result of this:is a Double containing the value 0.16. Note the different division operators. You are using the integer division operator, not the standard division operator.
For that code to compile at all you must have Option Strict turned Off, which it unfortunately is by default. I suggest that you turn it On immediately and keep it On for good.
Re: [2005] Label.text and Background Image Help
Thanks for the help, appreciated.