Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Blue color under the images used for toolbar buttons.
 

Blue color under the images used for toolbar buttons.

Hi..

I'm using thesehttp://www.iconfinder.net/search/?q=databaseicons for my toolbar buttons. But as you can see in the picture below(click to enlarge) there is some blue component around the images. Why is that coming? how to remove that? The images I used are PNGs and I've tried changing all the transparent properties I could find in toolbar.


Free Image Hosting at www.ImageShack.us

The last icon update2 is little different I used the *.ico instead of *.png. Situation became more worst as you can see. I images I've used are clean and very nice. Please tell me how to solve this problem?

yaazel  Friday, September 04, 2009 8:20 PM
Set the ImageLists ColorDepth property to 32Bit.

You will still get a bluish tint, but it won't be anywhere as noticeable as what you have now. To overcome this you must add the images to the ImageList at runtime rather than at design time.


Since you appear to be using Visual Studio 2008 you could be using the ToolStrip control rather than the ToolBar control. Although ToolBar is still available it was replaced by the ToolStrip in VS2005 and is no longer in the default ToolBox.
Mick Doherty
http://dotnetrix.co.uk
Mick Doherty  Saturday, September 05, 2009 8:59 AM
what is that control used as toolbar ?

Thanks

â™?My Blog â™?My Flickr â™?My Facebook â™?/div>
Omie  Friday, September 04, 2009 9:27 PM
Omie seems to be in the right direction. It seems that the toolbar you are using does not support alpha channel transparency. Every pixel with alpha seems to come out blue. Have you run the project? Is it the same in runtime?

MCP
webJose  Friday, September 04, 2009 10:47 PM
yeah. I've run the project and its the same in runtime too.

>what is that control used as toolbar ?

System.Windows.Forms.Toolbar ofcourse. What else could it be? (I'm a newbie in GUI, This is the only control I know. If there are any others please specify).


I'm pasting the code
private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("asdf");
            System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("asdfasdf");
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.listView1 = new System.Windows.Forms.ListView();
            this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
            this.toolBar2 = new System.Windows.Forms.ToolBar();
            this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
            this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
            this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
            this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
            this.IconImageList = new System.Windows.Forms.ImageList(this.components);
            this.imageList1 = new System.Windows.Forms.ImageList(this.components);
            this.SuspendLayout();
            // 
            // listView1
            // 
            this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.columnHeader1,
            this.columnHeader2});
            this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
            listViewItem2.ToolTipText = "yaazeltooltip";
            this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
            listViewItem1,
            listViewItem2});
            this.listView1.Location = new System.Drawing.Point(88, 181);
            this.listView1.Name = "listView1";
            this.listView1.Size = new System.Drawing.Size(361, 149);
            this.listView1.TabIndex = 0;
            this.listView1.UseCompatibleStateImageBehavior = false;
            this.listView1.View = System.Windows.Forms.View.Details;
            // 
            // columnHeader1
            // 
            this.columnHeader1.Text = "Name";
            this.columnHeader1.Width = 131;
            // 
            // columnHeader2
            // 
            this.columnHeader2.Text = "____";
            // 
            // toolBar2
            // 
            this.toolBar2.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
            this.toolBarButton1,
            this.toolBarButton2,
            this.toolBarButton3,
            this.toolBarButton4});
            this.toolBar2.ButtonSize = new System.Drawing.Size(32, 32);
            this.toolBar2.DropDownArrows = true;
            this.toolBar2.ImageList = this.IconImageList;
            this.toolBar2.Location = new System.Drawing.Point(0, 0);
            this.toolBar2.Name = "toolBar2";
            this.toolBar2.ShowToolTips = true;
            this.toolBar2.Size = new System.Drawing.Size(671, 84);
            this.toolBar2.TabIndex = 1;
            this.toolBar2.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar2_ButtonClick);
            // 
            // toolBarButton1
            // 
            this.toolBarButton1.ImageIndex = 0;
            this.toolBarButton1.Name = "toolBarButton1";
            this.toolBarButton1.Text = "add";
            // 
            // toolBarButton2
            // 
            this.toolBarButton2.ImageIndex = 1;
            this.toolBarButton2.Name = "toolBarButton2";
            this.toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
            this.toolBarButton2.Text = "upload";
            // 
            // toolBarButton3
            // 
            this.toolBarButton3.ImageIndex = 2;
            this.toolBarButton3.Name = "toolBarButton3";
            this.toolBarButton3.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
            this.toolBarButton3.Text = "edit";
            // 
            // toolBarButton4
            // 
            this.toolBarButton4.ImageIndex = 6;
            this.toolBarButton4.Name = "toolBarButton4";
            this.toolBarButton4.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
            this.toolBarButton4.Text = "upload2";
            // 
            // IconImageList
            // 
            this.IconImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("IconImageList.ImageStream")));
            this.IconImageList.TransparentColor = System.Drawing.Color.Transparent;
            this.IconImageList.Images.SetKeyName(0, "AddToDB.png");
            this.IconImageList.Images.SetKeyName(1, "BulkUpload.png");
            this.IconImageList.Images.SetKeyName(2, "Edit.png");
            this.IconImageList.Images.SetKeyName(3, "PatientInfo.png");
            this.IconImageList.Images.SetKeyName(4, "RemoveFromDB.png");
            this.IconImageList.Images.SetKeyName(5, "Search.png");
            this.IconImageList.Images.SetKeyName(6, "BulkUpload.ico");


            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.ClientSize = new System.Drawing.Size(671, 409);
            this.Controls.Add(this.toolBar2);
            this.Controls.Add(this.listView1);
            this.Cursor = System.Windows.Forms.Cursors.Default;
            this.Name = "Form1";
            this.Opacity = 0;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Form1";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

yaazel  Saturday, September 05, 2009 5:19 AM
Set the ImageLists ColorDepth property to 32Bit.

You will still get a bluish tint, but it won't be anywhere as noticeable as what you have now. To overcome this you must add the images to the ImageList at runtime rather than at design time.


Since you appear to be using Visual Studio 2008 you could be using the ToolStrip control rather than the ToolBar control. Although ToolBar is still available it was replaced by the ToolStrip in VS2005 and is no longer in the default ToolBox.
Mick Doherty
http://dotnetrix.co.uk
Mick Doherty  Saturday, September 05, 2009 8:59 AM

You can use google to search for other answers

Custom Search

More Threads

• MouseClick event at design-time
• Sample please - structures and text files
• Help needed for WinForm Application
• Windows Forms Designer Instablility
• Gridview view issue
• any way to determine if a control is a "container"
• Designer resizing control automatically
• when using codeDomSerializer - how to get the object when openning the designer
• Custom menu items serialization ...
• Designer Hanging Loading Form