2013-07-11 73 views

回答

4

只需设置按钮的BackgroundImage属性即可。举个例子:

button1.BackgroundImage = ((System.Drawing.Image)(Properties.Resources.Image)); 
+0

得益于它完美 – TheMrRafus

+0

不客气。如果是,请将问题标记为已回答。 – dsfgsho

3

,每当你想设置你会在加载应用程序中使用此,或。

button.BackgroundImage = YourApplicationNamespace.Properties.Resources.yourImageHere; 
3

在Visual Studio中,你可以这样做:

  1. 转到按钮所处的属性,然后单击BackgroundImage项目。
  2. 点击'...'图标。
  3. 单击“本地资源”旁边的单选按钮。
  4. 点击'导入',然后选择你想要的项目作为背景。
  5. 然后,点击“确定”。

或者,从代码,你可以这样做:

button1.BackgroundImage = ((System.Drawing.Image)(Properties.Resources.Image)); 
相关问题