assimang
Programmer
- Mar 11, 2008
- 96
Hello everybody,
I have a teaching typing form in my application and when the user completes an exercise if his accuracy and his speed are good I want in a picturebox to display a png icon and if the his speed and accuracy are bad, to display a gif icon. These icons are in resources folder. I am wandering if in vb.net there is something like myapp.path in vb6 to determine the filepath of my application?
I was thinking
EmotionPictureBx.Image = Image.FromFile(My.Resources.smile)
but it gives me error Error Value of type 'System.Drawing.Bitmap' cannot be converted to 'String'. What can I do? I don't want to determine a path like "c:\smile" for example because when I finish the program and deploy it, I don't want my app searches the icon in a hard disk. It is sure that will give error. It's expected that I will install it in other computers, so it must be somewhere in my application like resources maybe, and I have to find a way to access it and load it into the picturebox. Any help much appreciated.
Thanks in advanced.
I have a teaching typing form in my application and when the user completes an exercise if his accuracy and his speed are good I want in a picturebox to display a png icon and if the his speed and accuracy are bad, to display a gif icon. These icons are in resources folder. I am wandering if in vb.net there is something like myapp.path in vb6 to determine the filepath of my application?
I was thinking
EmotionPictureBx.Image = Image.FromFile(My.Resources.smile)
but it gives me error Error Value of type 'System.Drawing.Bitmap' cannot be converted to 'String'. What can I do? I don't want to determine a path like "c:\smile" for example because when I finish the program and deploy it, I don't want my app searches the icon in a hard disk. It is sure that will give error. It's expected that I will install it in other computers, so it must be somewhere in my application like resources maybe, and I have to find a way to access it and load it into the picturebox. Any help much appreciated.
Thanks in advanced.