S
Stork via DotNetMonster.com
Hi,
I have a program that has a row of buttons that use MouseEnter/MouseLeave to
change between two different colored images. I also have other images that I
pull from the filing system. Since I have several thousands pictures of
product, putting the images in an ImageList is out of the question as that
would make the EXE file insanely huge and eat up tons of resources.
My problem is I am trying to avoid having to type the full path of the images
(C:\Program Files\etc) so that no matter where a user installs the program,
and no matter the drive letter/name, it will work correctly. Everything works
fine until I open the Save or Open Dialog box, and then when an image is
pulled from the file system it throws up a 'File Not Found Exception'.
Code:
private void btnSave_Click(object sender, EventArgs e)
{
fileSave.ShowDialog();
}
private void btnSave_MouseEnter(object sender, EventArgs e)
{
btnSave.Image = System.Drawing.Image.FromFile(@"Images\Main\save-
oj.jpg");
}
private void btnSave_MouseLeave(object sender, EventArgs e)
{
btnSave.Image = System.Drawing.Image.FromFile(@"Images\Main\save-
blu.jpg");
}
Any idea on how I can get around this problem?
I have a program that has a row of buttons that use MouseEnter/MouseLeave to
change between two different colored images. I also have other images that I
pull from the filing system. Since I have several thousands pictures of
product, putting the images in an ImageList is out of the question as that
would make the EXE file insanely huge and eat up tons of resources.
My problem is I am trying to avoid having to type the full path of the images
(C:\Program Files\etc) so that no matter where a user installs the program,
and no matter the drive letter/name, it will work correctly. Everything works
fine until I open the Save or Open Dialog box, and then when an image is
pulled from the file system it throws up a 'File Not Found Exception'.
Code:
private void btnSave_Click(object sender, EventArgs e)
{
fileSave.ShowDialog();
}
private void btnSave_MouseEnter(object sender, EventArgs e)
{
btnSave.Image = System.Drawing.Image.FromFile(@"Images\Main\save-
oj.jpg");
}
private void btnSave_MouseLeave(object sender, EventArgs e)
{
btnSave.Image = System.Drawing.Image.FromFile(@"Images\Main\save-
blu.jpg");
}
Any idea on how I can get around this problem?