Source/TabStripSimulatedThemeDisplay.cs

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace DevComponents.DotNetBar
{
	/// <summary>
	/// Provides display support for SimualtedTheme tab style.
	/// </summary>
	internal class TabStripSimulatedThemeDisplay:TabStripBaseDisplay
	{
		public TabStripSimulatedThemeDisplay()
		{
			this.HorizontalText=true;
		}

		#region Methods
		public override void Paint(Graphics g, TabStrip tabStrip)
		{
			base.Paint(g,tabStrip);

			TabColorScheme colorScheme=tabStrip.ColorScheme;
			Rectangle clientRect=tabStrip.ClientRectangle;

            if (tabStrip.BackColor != Color.Transparent || colorScheme.TabBackground != Color.Transparent)
            {
                if (colorScheme.TabPanelBackground2.IsEmpty)
                {
                    if (!colorScheme.TabPanelBackground.IsEmpty)
                    {
                        using (SolidBrush brush = new SolidBrush(colorScheme.TabPanelBackground))
                            g.FillRectangle(brush, clientRect);
                    }
                }
                else
                {
                    using (SolidBrush brush = new SolidBrush(Color.White))
                        g.FillRectangle(brush, clientRect);
                    using (LinearGradientBrush brush = CreateTabGradientBrush(clientRect, colorScheme.TabPanelBackground, colorScheme.TabPanelBackground2, colorScheme.TabPanelBackgroundGradientAngle))
                        g.FillRectangle(brush, clientRect);
                }
            }

			tabStrip.ClipExcludeSystemBox(g);

			DrawBackgroundInternal(clientRect,g,colorScheme,new Region(tabStrip.DisplayRectangle),tabStrip.TabAlignment, tabStrip.TabItemsBounds);

			for(int i=tabStrip.Tabs.Count-1;i>=0;i--)
			{
				TabItem tab=tabStrip.Tabs[i];

				if(!tab.Visible || tab.IsSelected || !tab.DisplayRectangle.IntersectsWith(clientRect))
					continue;
			
				PaintTab(g,tab,false,false);
			}

			if(tabStrip.SelectedTab!=null && tabStrip.Tabs.Contains(tabStrip.SelectedTab))
				PaintTab(g,tabStrip.SelectedTab,false,false);

后面还有 334 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。