• 初始化toolstrip


            /// <summary>
            /// 初始化工具条
            /// </summary>
            private void InitializeToolbar()
            {
                Image img = global::Win.Properties.Resources.mainfram;
                //240 15
                int heigh = 15;
                int width = 16;
                for (int i = 0; i < 15; i++)
                {
                    Bitmap bitmap = new Bitmap(16, 15, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
                    Graphics graphics = Graphics.FromImage(bitmap);
                    graphics.DrawImage(img, new Rectangle(0, 0, width, heigh), i * width, 0, 16, 15, GraphicsUnit.Pixel);
                    ToolStripButton tsb = new ToolStripButton();
                    tsb.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                    tsb.Image = Image.FromHbitmap(bitmap.GetHbitmap());
                    tsb.ImageTransparentColor = System.Drawing.Color.Magenta;
                    tsb.Name = "tsbtn" + i;
                    tsb.Size = new System.Drawing.Size(23, 22);
                    tsb.Text = "toolStripButton1";
                    tsb.Click += new EventHandler(tsb_Click);
                    tsToll.Items.Add(tsb);
                }
            }
    

      

  • 相关阅读:
    转Vtype扩展
    Can't connect to MySQL server on 'ip' (13)
    观察者+js 模式
    (转)ASP.NET架构分析
    sql得到时间
    Js+XML 操作 (转)
    js中的math对象
    property和attribute的区别
    CSS样式定义
    linux 开启 mount
  • 原文地址:https://www.cnblogs.com/crazycxy/p/2525838.html
Copyright © 2020-2023  润新知