Hello everybody. I am creating a richtext toolbar. When adding the images to the toolbar, I get an out of memory error. This happens on just the third image. The files are only 1KB a piece in size. I am sure there is a way this can be done and would appreciate any help you can give. Thanks and have a great day. Below is the code I use to load the bitmap. I have also tried the code without the btm.Dispose().
' Load Images
Dim imglstRichText As ImageList = New ImageList()
Dim img As Image
Dim btm As Bitmap
btm = img.FromFile(strDefaultPath & "bold.gif")
imglstRichText.Images.Add(btm)
btm.Dispose()
btm = img.FromFile(strDefaultPath & "italic.gif")
imglstRichText.Images.Add(btm)
btm.Dispose()
btm = img.FromFile(strDefaultPath & "underline.gif")
imglstRichText.Images.Add(btm)
btm.Dispose()
Me.tlbBIU.ImageList = imglstRichText
Me.btnBold.ImageIndex = 0
Me.btnItalics.ImageIndex = 1
Me.btnUnderLine.ImageIndex = 2
imglstRichText = Nothing
Randy Belcher
AFG Industries, Inc.