this.groupBox1.BackgroundImage = global::WindowsFormsApplication25.Properties.Resources.beijing//WindowsFormsApplication25是项目名beijing是图片
其实这个你完全可以查到,你先用控件设置一个背景,然后鼠标移到
class Form1的form1上按F12,之后会进入到一个Form1.Designer.cs(当然你也可以手动点进去,因为这个就在你创建form下面),然后里面会有许多定义的控件,找到你定义的那个,你就可以看到它默认属性,生成的代码啦!
If Grou(0).Controls.Count >= 8 AndAlso Grou(0).Controls(8).GetType.Name.Equals("PictureBox") ThenDim PictureBox As PictureBox = TryCast(Grou(0).Controls(8), PictureBox)
PictureBox.Image = Image.FromFile(Application.StartupPath & "\3.JPG")
End If
Dim List As New List(Of PictureBox)For Each PictureBox As PictureBox In GroupBox1.Controls.OfType(Of PictureBox)
List.Add(PictureBox)
Next
Dim Array As Array = List.Where(Function(t)
Dim Int As Integer = Integer.Parse(t.Name.Replace("PictureBox", ""))
If Int > 5 AndAlso Int < 8 Then
Return True
Else
Return False
End If
End Function).ToArray
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)