View Single Post
  #1 (permalink)  
Old May 24th, 2012, 02:16 AM
sumith sumith is offline
Authorized User
Points: 270, Level: 5
Points: 270, Level: 5 Points: 270, Level: 5 Points: 270, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Priblem with picturebox and icon from .resx file


I am working on a vb6 to migration project using VS 3.5. In my application, there is .resx file and some icons are there in this file (eg: icoIN,icoUS etc). On click of a checked listbox (which is filled with country names), the particular country flag should be displayed on a picture box control. The image of country flag is taken from the .resx file.I tried with the following code.
Dim iconStream As Stream = Nothing
Dim bmp As Bitmap = Nothing
'lstcountries is the checkedlistbox and imgcountry is the picturebox
If lstcountries.getitemchecked(EventArgs.index) Then
imgcountry.visible = True
iconStream = System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("icoIN")
bmp = New Bitmap(iconStream)
imgcountry.image = bmp
Catch ex As Exception
but the iconstream is returning an empty value and the picture box not displaying any image. Can anybody help me on this issue.
Any help appreciated.