예제 #1
0
        private Image GetPageImage(int rowHandle, int relationIndex)
        {
            DrawTabImageEventArgs args = new DrawTabImageEventArgs(rowHandle, null, relationIndex);

            OnDrawTabImage(args);
            return(args.Image);
        }
        void GetTabImage(object sender, DrawTabImageEventArgs e)
        {
            CustomerType value = (CustomerType)customGridView1.GetRowCellValue(e.RowHandle, customGridView1.Columns["CustomerType"]);

            if (e.RelationIndex == 0)
            {
                switch (value)
                {
                case CustomerType.Person:
                    e.Image = GetImageByName(e, "Person.bmp");
                    break;

                case CustomerType.Company:
                    e.Image = GetImageByName(e, "Company.png");
                    break;

                default:
                    break;
                }
            }
            else
            {
                e.Image = GetImageByName(e, "Delivered.png");
            }
        }
예제 #3
0
 public virtual void OnDrawTabImage(DrawTabImageEventArgs e)
 {
     if (GetTabImage != null)
     {
         GetTabImage(this, e);
     }
 }
 private Image GetImageByName(DrawTabImageEventArgs e, string imageName)
 {
     return(Image.FromStream(this.GetType().Assembly.GetManifestResourceStream(String.Format("S133193Example.{0}", imageName))));
 }