• 0

32Bit Icons In Toolbar?


Question

14 answers to this question

Recommended Posts

  • 0
  dannyres said:
Try calling Application.EnableVisualStyles or something like that.  If I remember right that fixes it.  The problem occurs when converting the icon to Bitmap, so if possible add the Icon directly instead of converting to Bitmap.

Dan

From a imagelist how do I add icons instead of bitmap? I use the properties to add and it convert them to bitmap.

Can someone interprete this? http://www.dotnet247.com/247reference/msgs/3/18031.aspx

Edited by Alvin
  • 0
  weenur said:
Set the ColorDepth property of the ImageList to Depth32Bit. You want to use bitmaps as opposed to the Icon class. The Icon class is more for interoperabilty.

I know bout the colordepth, just than when it's convert to bitmap the alpha channel is painted solid black as oppose to a icon like those on Microsoft own product.

  • 0

I didn't code anything, just clicky click on the properties tab.

? ? ? ?'
 ? ? ? ?'ImageList1
 ? ? ? ?'
 ? ? ? ?Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit
 ? ? ? ?Me.ImageList1.ImageSize = New System.Drawing.Size(48, 48)
 ? ? ? ?Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
 ? ? ? ?Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
 ? ? ? ?'
 ? ? ? ?'ToolBar1
 ? ? ? ?'
 ? ? ? ?Me.ToolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
 ? ? ? ?Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2, Me.ToolBarButton3, Me.ToolBarButton4})
 ? ? ? ?Me.ToolBar1.DropDownArrows = True
 ? ? ? ?Me.ToolBar1.ImageList = Me.ImageList1
 ? ? ? ?Me.ToolBar1.Location = New System.Drawing.Point(0, 0)
 ? ? ? ?Me.ToolBar1.Name = "ToolBar1"
 ? ? ? ?Me.ToolBar1.ShowToolTips = True
 ? ? ? ?Me.ToolBar1.Size = New System.Drawing.Size(520, 60)
 ? ? ? ?Me.ToolBar1.TabIndex = 13
 ? ? ? ?'
 ? ? ? ?'ToolBarButton1
 ? ? ? ?'
 ? ? ? ?Me.ToolBarButton1.ImageIndex = 0
 ? ? ? ?'
 ? ? ? ?'ToolBarButton4
 ? ? ? ?'
 ? ? ? ?Me.ToolBarButton4.ImageIndex = 1

Generate by Windows Form Designer

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.