메서드를 사용하여 모든 버튼의 backgroundimage 경로를 가져 오려고하지만 경로를 가져올 수 없습니다. 이것은 내 코드C에서 버튼의 BackgroundImage 경로를 얻는 방법 #
b1.BackgroundImage = Image.FromFile(C:\\Users\\m\\Documents\\Visual Studio
2010\\Projects\\PApp\\Papp\\1.jpg) ;
b2.BackgroundImage = Image.FromFile(C:\\Users\\m\\Documents\\Visual Studio 2010\\Projects\\PApp\\Papp\\2.jpg) ;
Console.WriteLine(b2.BackgroundImage);
Console.WriteLine(b1.BackgroundImage);
I 버튼에 이미지를 표시 할 수 있습니다,하지만 난 그것을 콘솔에서 경로를 표시 할,하지만 내가 갖는 모든 System.Drawing.Bitmap입니다. 길은 정적입니다.
this.button1.BackgroundImage = global::WindowsFormsApplication5.Properties.Resources.my_image_name;
당신이 볼 수 있듯이,이 값에 영향을주는 것 : 당신은 윈폼 디자이너를 사용하여 BackgroundImage 속성을 설정 한 경우