Gradient Effect!

Kieto
08-17-2001, 10:16 PM
Is it possible to have a gradient effect on a ssTab object?

Derek Stone
08-18-2001, 07:04 AM
Yes it is. However it is extremely complicated. Much more so than its worth.
Nonetheless, what you would do is subclass the SSTab control, capture the WM_PAINT message, find its hDC, and then draw to it.
Drawing to it will be the the most complicated part, do to its unusual shape.
If you decide to take on this endeavor, write back for more information.
"The Hand" will also be of great assistance to you I suspect.

Good Luck
-cl

Garrett Sever
08-18-2001, 08:28 AM
Sounds somewhat challenging...

However I can think of an easier way (and more permanent way) of doing that...

1) Put a picturebox on each page
2) Use SetWindowRgn to fit it to the shape (or just ignore the tabs...)
3) Draw the gradient to the pictureboxes using your preferred method...

However I can look into it if there is a need...

Later!
-<font color=blue>The Hand, </font color=blue>OUT....


<font color=green>"On a long enough timeline, everyone's life expectancy drops to zero."</font color=green> - Fight Club

Derek Stone
08-18-2001, 06:42 PM
I thought about that too, but it would involve as many picture boxes as you have tabs.
And you'd still have to capture the paint message... or atleast when the user changes tabs.
I'd like to do this though. Good challenge. Maybe you and I could join forces.

Later,
-cl

Garrett Sever
08-19-2001, 11:27 AM
Sure thing... don't mind a challenge myself, however I still think that the picturebox thing might be a better solution... despite the extra pictureboxes. The SSTab has always been a rather wiley control at best, and adding subclassing instability to it makes me nervous...

When I suggested the pictureboxes thing, you wouldn't actually have to capture the paint message. You could either put the code in a <font color=blue>Sub</font color=blue> Picture1_Paint(Index <font color=blue>As Integer</font color=blue>) event or set the AutoRedraw = 1 and paint to all of them in the Form_Load() event...

But lets give it a shot. I'll see what I can figure out using Spy++ tomorrow when I get to work.

-Out

<font color=green>"On a long enough timeline, everyone's life expectancy drops to zero."</font color=green> - Fight Club

Garrett Sever
08-20-2001, 10:07 PM
OK, well I did it.

Well, actually I took it a step further and tiled a background image across the SSTab. If you want to have a gradient, then change the code marked in the project where the background image is drawn in.

Regards,
-<font color=orange>The Hand</font color=orange>

<font color=green>"On a long enough timeline, everyone's life expectancy drops to zero."</font color=green> - Fight Club

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum