DevExpress XtraTabControl TabHeader Customizing

Published Jul 12, 2013 | Updated Sep 28, 2022 | 0 comments

TabHeader 의 높이(위치가 Top 일때)를 임의 크기로 변경

좌측상단 꺽이는 부분을 없애기 위함

변경사항

Customizing 을 위해 별도 클래스 생성

using System.Drawing;

using DevExpress.XtraTab;
using DevExpress.XtraTab.ViewInfo;
namespace KKOMZI
{
    public class MyTabControl : XtraTabControl 
    { 
        public MyTabControl() : base() 
        { 
            DevExpress.XtraTab.Registrator.PaintStyleCollection.DefaultPaintStyles.Add(new MyViewInfoRegistrator());
        }
    }
    public class MyViewInfoRegistrator : DevExpress.XtraTab.Registrator.SkinViewInfoRegistrator
    {
        public override string ViewName
        {
            get
            {
//				return base.ViewName;
                return "MyView";
            }
        }
        public override BaseTabHeaderViewInfo CreateHeaderViewInfo(BaseTabControlViewInfo viewInfo) 
        { 
            return new MyHeaderViewInfo(viewInfo); 
        }
    }
    public class MyHeaderViewInfo : DevExpress.XtraTab.ViewInfo.SkinTabHeaderViewInfo
    {
        /// <summary>
        /// 탭 헤더 높이
        /// </summary>
        private int TabHeight = 40; 
        public MyHeaderViewInfo(BaseTabControlViewInfo viewInfo) : base(viewInfo) { }
        protected override Size CalcHPageSize(BaseTabPageViewInfo info)
        {
            Size size = base.CalcHPageSize(info);
//			size.Height += 50;
            size.Height = TabHeight;
            size.Height = TabHeight; return size;
        }
        protected override Rectangle CalcRowClientBounds(BaseTabRowViewInfo row, Rectangle headerClient)
        {
            Rectangle rect = base.CalcRowClientBounds(row, headerClient);
//			rect.Inflate(0, -20);
            return rect;
        }
        /// <summary>
        ///  탭 헤더 시작위치 변경(좌측 상단 꺽이는 부분을 없애기 위해) : 스킨마다 좀 다른듯?
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        protected override Point CalcStartPoint(Point p)
        {
            int num = -1; 
            int num2 = 2; 
            if (this.IsSideLocation) 
            { 
                p.Y += num; 
                if (this.HeaderLocation == TabHeaderLocation.Left) 
                    p.X += num2;
            } 
            else
            {
                p.X += num;
                if (this.HeaderLocation == TabHeaderLocation.Top)
                    p.Y += num2; 
            }
            return p;
        }
    }
}

실제 사용시 PaintStyleName 를 맞춰주면됨

myTabControl1.LookAndFeel.SetStyle(DevExpress.LookAndFeel.LookAndFeelStyle.Skin, false, false, "Office 2007 Blue");
myTabControl1.PaintStyleName = "MyView";

TAG INFORMATION

Learn more on this topic

Related Blog Posts

DevExpress XtraGrid 의 특정 Row Handle 과 Grid DataSource 의 Index

XPO 와 Grid 를 연동해서 작업을 하던중 알아낸 차이점 Grid 의 선택된 RowHandle 받기 - gridView2.GetSelectedRows() 실제 Grid 의 선택된 Row 의 실제 데이터소스의 Index 받아오기 - gridView2.GetDataSourceRowIndex(gridView2.GetSelectedRows()[0]) 2008-09-02 추가 그리고.. 추가로 위의 소스로 데이터를 한개의 Row 씩 순차적으로 삭제할때(Grid, DataSource...

read more
ClickOnce 업데이트 서버 구성 방법 정리

ClickOnce 업데이트 서버 구성 방법 정리

1. IIS 설치 후 FrontPage Server Extensions 2002 구성 구성이 되면 아래와 같이 별도 탭이 생성됨 2. IIS 셋팅 - 인증 3. IIS 셋팅 - HTTP 헤더 설정 콘텐츠 만료 지정 하고 즉시 만료로 하면 업데이트시 캐쉬를 신경쓰지 않아도 됨 사용자 지정 HTTP 헤더 확인 – 없으면 추가 4. IIS 셋팅 - ASP.NET 설정 현재 개발 프레임웍에 맞게끔 설정이 되어있는지 확인 MIME 형식 연결 MIME 설정은...

read more

Join in the conversation

Leave a Comment

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

무료 온라인 전광판

전광판

텍스트를 입력하고 텍스트 효과 및 배경효과 를 변경해서 전체화면으로 표시할 수 있는 전광판 용도로 사용하실 수 있습니다. 각종 스포츠 및 공연 관람시 응원 용도로 사용이 가능합니다.

Carousel

여러개의 슬라이드를 추가하여 프레젠테이션 및 이미지 슬라이드 용도로 사용하실 수 있습니다. 브라우저가 포함된 IT 기기로 큰 모니터에 연결하여 매장 내 공지사항 및 메뉴소개를 이미지로 표시할 수 있습니다.

Pin It on Pinterest

Shares
Share This

Share This

Share this post with your friends!

Shares