Hi David,
First of all, I would like to confirm my understanding of your issue.
From your description, I understand that after you install directx9.0b, the
imagelist will not work on your machine.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.
Is the DirectX 9.0b you have installed the one in the windows update
website, or is it a runtime or a directx 9.0 sdk?
Based on my knowledge, the DirectX library will not impact the ImageList
which will use the comctl32.dll underlying.
Also I can not reprodue the problem that all the new image added into the
imagelist are all PixelFormat = Format8bppIndexed and RawFormat = Bmp, on
my side the two properties will depend on the real format of the image.
Have you tried to create a new windows form project and add a imagelist
,and then add a few pictures into the imagelist, did the problem persists?
If no, can you build a simple reproduce sample and post here or send to me
by removing the "online" from my email address.
But I can reproduce the problem that we can not change the transparentcolor
of the imagelist in the IDE designer. As a workaround, I think we can try
to rebuild the imagelist on the fly everytime we need to change the
transparentcolor.
Here is the code snippet, you may have a try and let me know the result.
<code>
Dim il As ImageList
Private Sub RebuildImageList()
If Not il Is Nothing Then
Me.components.Remove(il)
End If
il.Dispose()
il = Nothing
il = New ImageList
il.ColorDepth = ColorDepth.Depth32Bit
il.ImageSize = New System.Drawing.Size(32, 32)
il.Images.Add(New Bitmap("C:\red.bmp"))
il.Images.Add(New Bitmap("C:\blue.bmp"))
il.Images.Add(New Bitmap("C:\green.bmp"))
Me.components.Add(il)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
components = New System.ComponentModel.Container
il = New ImageList
RebuildImageList()
il.TransparentColor = Color.Blue
For i As Integer = 1 To 12
Me.ListView1.Items.Add(i.ToString(), i Mod 3)
Next
Me.ListView1.LargeImageList = il
End Sub
Shared times As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim c As Integer = times Mod 3
Select Case c
Case 0
RebuildImageList()
il.TransparentColor = Color.Green
Me.ListView1.LargeImageList = il
Case 1
RebuildImageList()
il.TransparentColor = Color.Red
Me.ListView1.LargeImageList = il
Case 2
RebuildImageList()
il.TransparentColor = Color.Blue
Me.ListView1.LargeImageList = il
End Select
times += 1
End Sub
</code>
Please apply my suggestion above and let me know if it helps resolve your
problem.
However, if the problem still persists, please help me collect more
information for further troubleshooting.
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.