The solution consists of a WinForms project with a single form and a single custom control included. In order to get started, start up the Visual Studio 2005 IDE and open the included project. Standard Tab Control with Gradient Added Getting Started At any rate, there is a much simpler solution.įigure 2. Naturally, you may draw a gradient on the background of each of the controls, but it would be difficult to match the gradient on the control with the gradient on the background, and it still likely would not look that great due to any mismatches in the patterns. The controls shown on the tab page actually have their background colors set to transparent, but as you can see in the figure, the area behind the group panel and label control appears to be white. In figure 2, the gradient is added dynamically against the graphics context of each tab page in the tab control. In contrast, adding the gradient to the graphics context for each tab page dynamically, may lead to less than desirable results. Even though the background is persistent, it is dynamically updated whenever it is resized or painted. In this example, the standard Windows Forms Tab control is extended to provide a persistent gradient background this differs from using an approach where a gradient background is created directly against the graphics context of each of the control’s tab pages. This article describes a quick and simple approach to creating a tabbed custom control with a gradient background.
0 Comments
Leave a Reply. |