VB.NET out of memory exception
问题 This is my code to populate a flow-layout-panel with pictureboxes : For Each fi As FileInfo In New DirectoryInfo(Application.StartupPath + "\data\img\em_sml").GetFiles() Dim pbx1 As New PictureBox pbx1.Width = 32 pbx1.Height = 32 pbx1.BackColor = Color.Azure pbx1.Image = Image.FromFile(fi.FullName) AddHandler pbx1.Click, AddressOf pbx1_click FlowLayoutPanel1.Controls.Add(pbx1) Next Suddenly i am getting out-of-memory error in the following line : pbx1.Image = Image.FromFile(fi.FullName) Why ?