Page 1 of 1

HELP! Move an image depending on how big a number is

Posted: Wed Apr 20, 2011 6:48 am
by noobcake
Hello, I am making something shit, but its for the sake of learning, its not of any use :)
But, It is something that works out how much 1 Gold coin is worth in copper coins, in a game.
I want it to look like this: Image
That looks good, but if you enter a number too big then it looks like this :

Image
I was wondering how to make it so the picture of the Copper moves to the right if the number is too close to it / overlapping. Because the copper picture is behind the number on the second one, how do i make the second look like the first one but with the bigger number
Appreciate any help thanks :)
~Noobcake

Re: HELP! Move an image depending on how big a number is

Posted: Wed Apr 20, 2011 7:43 am
by Dummy1912
Hello noobcake,

did you tried to set the picturebox ---> look into options right panel and search for
Anchor
and set it to : Top , Right

hope it works.
goodluck

Dummy1912

Re: HELP! Move an image depending on how big a number is

Posted: Wed Apr 20, 2011 12:52 pm
by mandai
Changing the anchor won't help much unless the form is resized once the number length changes.
You can set the image's left location to be at the right of the label.
Code: Select all
        lblNumber.Text = "190,000"
        picCopper.Left = lblNumber.Right

Re: HELP! Move an image depending on how big a number is

Posted: Fri Apr 22, 2011 11:01 am
by noobcake
mandai wrote:
Changing the anchor won't help much unless the form is resized once the number length changes.
You can set the image's left location to be at the right of the label.
Code: Select all
        lblNumber.Text = "190,000"
        picCopper.Left = lblNumber.Right
THANKS! that worked great, I would +rep you but I can't +rep you 2 times in a row :P ahwelll
lol

Re: HELP! Move an image depending on how big a number is

Posted: Fri Apr 22, 2011 11:01 am
by noobcake
~~~~~~~~~~~~~~~~~~~~~LOCKED~!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
thanks again guys :) Got what i needed