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 = Format8bppIndex ed 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 transparentcolo r
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
transparentcolo r.
Here is the code snippet, you may have a try and let me know the result.
<code>
Dim il As ImageList
Private Sub RebuildImageLis t()
If Not il Is Nothing Then
Me.components.R emove(il)
End If
il.Dispose()
il = Nothing
il = New ImageList
il.ColorDepth = ColorDepth.Dept h32Bit
il.ImageSize = New System.Drawing. Size(32, 32)
il.Images.Add(N ew Bitmap("C:\red. bmp"))
il.Images.Add(N ew Bitmap("C:\blue .bmp"))
il.Images.Add(N ew Bitmap("C:\gree n.bmp"))
Me.components.A dd(il)
End Sub
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
components = New System.Componen tModel.Containe r
il = New ImageList
RebuildImageLis t()
il.TransparentC olor = Color.Blue
For i As Integer = 1 To 12
Me.ListView1.It ems.Add(i.ToStr ing(), i Mod 3)
Next
Me.ListView1.La rgeImageList = il
End Sub
Shared times As Integer = 0
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim c As Integer = times Mod 3
Select Case c
Case 0
RebuildImageLis t()
il.TransparentC olor = Color.Green
Me.ListView1.La rgeImageList = il
Case 1
RebuildImageLis t()
il.TransparentC olor = Color.Red
Me.ListView1.La rgeImageList = il
Case 2
RebuildImageLis t()
il.TransparentC olor = Color.Blue
Me.ListView1.La rgeImageList = 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.