Click here to Skip to main content
15,894,343 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Automatically adding headers and footers in print documents Pin
Duncan Edwards Jones26-Jul-06 11:42
professionalDuncan Edwards Jones26-Jul-06 11:42 
QuestionDatatable.Select Problem Pin
eatwork26-Jul-06 5:51
eatwork26-Jul-06 5:51 
NewsCaedo HTTPd Web Server Pin
steve_ino26-Jul-06 5:40
steve_ino26-Jul-06 5:40 
QuestionCrystal reports. Pin
ImranIBM26-Jul-06 5:11
ImranIBM26-Jul-06 5:11 
AnswerRe: Crystal reports. Pin
Muhammad Jawad26-Jul-06 5:50
Muhammad Jawad26-Jul-06 5:50 
GeneralRe: Crystal reports. [modified] Pin
ImranIBM26-Jul-06 6:03
ImranIBM26-Jul-06 6:03 
Questionac Pin
70's live!26-Jul-06 5:08
70's live!26-Jul-06 5:08 
QuestionIcon loading for listviews (.ico files) Pin
Oneiroid26-Jul-06 4:59
Oneiroid26-Jul-06 4:59 
I am encountering the 'black icon' issue when loading .ico files into an ImageList for use with a ListView. If I load the icons into the ImageList as design-time, and pull them out with

' Create icon from ImageList<br />
    Public Function AssignIcon(ByVal ImgList As ImageList, ByVal indx As Int32)<br />
        Dim objBitmap As Bitmap<br />
        Dim objIcon As Icon<br />
        objBitmap = New Bitmap(ImgList.Images(indx))<br />
        objIcon = System.Drawing.Icon.FromHandle(objBitmap.GetHicon)<br />
        Return objIcon<br />
    End Function


the icons are visible but any transparency is replaced with black.

If I load the the ImageList at runtime, referencing icons which I've declared as embedded resources, with either:

Dim ico0 As New Icon(System.Reflection.Assembly.GetExecutingAssembly._<br />
GetManifestResourceStream("APKK.icnCD_16x16.ico"))<br />
 ImgList.Images.Add(ico0)


or

Dim ico0 As New Icon(Me.GetType(), "icnCD_16x16.ico")<br />
ImgList.Images.Add(ico0)


ALL I get is black boxes.

Setting other icons without going through an imagelist (like me.icon) using either of the two above code snippets displays the icon perfectly and preserves the transparency. But again, if I were to pull my icon out of an imagelist to set me.icon, it would not display correctly.

So I know it is possible that I can correctly display icons in my application when I do not use an ImageList. Is there any way I can assign an icon to a ListViewItem without using an ImageList? I suspect the answer is yes, but only by overriding the ListView class, and I have no idea where to start with that.

Perhaps there is a special technique which I've overlooked for loading the ImageList?

I like my icons as they are, and don't really relish the thought of manually turning them into bitmaps...

Any help appreciated! Let me know if more info is required. I am using VB.Net 2003.

Thank you!
QuestionSave data in a SQL Database Pin
Fitschen26-Jul-06 4:20
Fitschen26-Jul-06 4:20 
QuestionVB 6.0 SEARCHING CODE Pin
michael cheche26-Jul-06 3:02
michael cheche26-Jul-06 3:02 
AnswerRe: VB 6.0 SEARCHING CODE Pin
mr_lasseter26-Jul-06 6:05
mr_lasseter26-Jul-06 6:05 
QuestionLetter pack [modified] Pin
PixelPixie26-Jul-06 2:53
PixelPixie26-Jul-06 2:53 
Questionone to one milion conversion of numbers into words?? Pin
Brian Jay26-Jul-06 2:50
Brian Jay26-Jul-06 2:50 
AnswerRe: one to one milion conversion of numbers into words?? Pin
Dave Sexton26-Jul-06 4:53
Dave Sexton26-Jul-06 4:53 
AnswerRe: one to one milion conversion of numbers into words?? Pin
Nouvand3-Aug-06 23:55
Nouvand3-Aug-06 23:55 
QuestionForm to stay with a MDI Form [modified] Pin
directred26-Jul-06 1:25
directred26-Jul-06 1:25 
AnswerRe: Form to stay with a MDI Form Pin
Zahid Hayat26-Jul-06 2:11
Zahid Hayat26-Jul-06 2:11 
Questionvariable with databinding [modified] Pin
Smithers-Jones26-Jul-06 0:08
Smithers-Jones26-Jul-06 0:08 
AnswerRe: variable with databinding Pin
mr_lasseter26-Jul-06 6:01
mr_lasseter26-Jul-06 6:01 
Questiontabcontrol Pin
Smithers-Jones26-Jul-06 0:05
Smithers-Jones26-Jul-06 0:05 
AnswerRe: tabcontrol Pin
Christian Graus26-Jul-06 1:52
protectorChristian Graus26-Jul-06 1:52 
QuestionBinding the data Pin
slSoftware25-Jul-06 22:46
slSoftware25-Jul-06 22:46 
AnswerRe: Binding the data Pin
Christian Graus26-Jul-06 1:50
protectorChristian Graus26-Jul-06 1:50 
GeneralRe: Binding the data Pin
slSoftware26-Jul-06 18:34
slSoftware26-Jul-06 18:34 
GeneralRe: Binding the data Pin
Christian Graus26-Jul-06 19:55
protectorChristian Graus26-Jul-06 19:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.