﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » "Gradient Form Header" question</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 21:29:21 GMT</lastBuildDate><ttl>20</ttl><item><title>"Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10294.aspx</link><description>I see this control uses Label and PictureBox to show "Title" and Image. The Title and Image show as transparent on Gradient background.&lt;br&gt;
&lt;br&gt;
I also need to put label and Picture box on this control, but if they take the "BackColor" of the form and not the Gradient color of the control. How can I do it like the way Title and image shows?&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Mon, 16 Jul 2007 10:48:43 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10314.aspx</link><description>&lt;IMG src="http://forum.strataframe.net/Uploads/Images/62fece85-5053-48ca-86bb-5f1e.jpg"&gt;&lt;/P&gt;&lt;P&gt;It works in IE. Thanks Trent!</description><pubDate>Mon, 16 Jul 2007 10:48:43 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10312.aspx</link><description>[quote]I tried the "Insert Image", but it asks for URL, so I just attached it for you to look at my direction.&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;Use Internet Explorer to get a more detailed set of options to upload the image.&amp;nbsp; FireFox shows a different screen for some reason.</description><pubDate>Mon, 16 Jul 2007 10:38:03 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10311.aspx</link><description>[quote]Can this be considered more like an 'alpha' channel?[/quote]&lt;/P&gt;&lt;P&gt;That is what it is....the alpha.&lt;/P&gt;&lt;P&gt;[quote]By combining the base into gradient, you can create new colors[/quote]&lt;/P&gt;&lt;P&gt;That was its purpose.&amp;nbsp; It allows the themed colors to be toned down/up based on your needs if you use the ColorsONly ThemeSupport option.</description><pubDate>Mon, 16 Jul 2007 10:36:27 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10309.aspx</link><description>[quote]The valid values are 0-255, and this is the opacity for the gradient colors to show thorugh to the base color.[/quote]&lt;br&gt;
&lt;br&gt;
That's an interesting data. Can this be considered more like an 'alpha' channel? By combining the base into gradient, you can create new colors....:)</description><pubDate>Mon, 16 Jul 2007 10:03:55 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10308.aspx</link><description>Good morning Trent; Thanks for detailed answer.&lt;br&gt;
&lt;br&gt;
I understood your points very clearly, but due to the nature of my usage (I need to put lots of stuff on the form), it makes it hard to align everything via code rather using the designer. Here is a layout for my form using gradient background to start putting controls on them.&lt;br&gt;
&lt;br&gt;
[quote]The valid values are 0-255, and this is the opacity for the gradient colors to show thorugh to the base color....not the transparency of the control itself.[/quote]&lt;br&gt;
The info on 255 solved my problem if I go with ThemedPanel.&lt;br&gt;
&lt;br&gt;
Trent, if I don't have a way to host an image, is there a way to upload an image to the forum to show on the screen? I tried the "Insert Image", but it asks for URL, so I just attached it for you to look at my direction.&lt;br&gt;
&lt;br&gt;
Thanks again!&lt;br&gt;</description><pubDate>Mon, 16 Jul 2007 10:00:12 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10306.aspx</link><description>Oh, your other question:&lt;/P&gt;&lt;P&gt;[quote]For one, the base color throws everything off, even with opacity set 100.&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;The valid values are 0-255, and this is the opacity for the gradient colors to show thorugh to the base color....not the transparency of the control itself.</description><pubDate>Mon, 16 Jul 2007 09:31:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10305.aspx</link><description>[quote]&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class=smalltxt vAlign=top&gt;&lt;SPAN id=ctl02_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl06_lblFullMessage&gt;I see this control uses Label and PictureBox to show "Title" and Image. The Title and Image show as transparent on Gradient background.&lt;BR&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;[/quote]&lt;/P&gt;&lt;P&gt;Actually it does not use an image or label.&amp;nbsp; These are rendered onto the control in the OnPaint of the control.&lt;/P&gt;&lt;P&gt;[quote]I still would like to use the gradient header, but need to find out how to make label and picture transparent.[/quote]&lt;/P&gt;&lt;P&gt;Whenever you set a label or any other controls background to "Transparent" it will take the are on which is resides in its parent as the background....however, the GradientFormHeader control is not a parent control which means that no child object actually resides within the control itself.&amp;nbsp; So the labels parent is the form or container it resides within.&lt;/P&gt;&lt;P&gt;You have a couple of options.&amp;nbsp; First, just render your text on the gradient form header.&amp;nbsp; Handle the Paint event of the GradientFormHeader and just add your logic to render on top of it.&amp;nbsp; Second option would be to handle the Paint event of the label and capture the background of the rendered GradientFormHeader using the DrawToBitmap or the ScreenCapture classes...either way will work.&amp;nbsp; And then create your own transparency....this is ultimately what happens natively anyway.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/4063add7-8908-497d-a187-c0e5.png"&gt;&lt;/P&gt;&lt;P&gt;The example above may be the approach you want to take.&amp;nbsp; I just created a new class, inherited from GradientFormHeader, overwrote the OnPaint method and added my logic.&amp;nbsp; You could create property that you set that adds this text to your header.&amp;nbsp; Below is the OnPaint code for the above example:&lt;/P&gt;&lt;P&gt;[codesnippet]Public Class CustomHeader&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits MicroFour.StrataFrame.UI.Windows.Forms.GradientFormHeader&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.OnPaint(e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Graphics.DrawString("My Custom Text", Me.Font, Drawing.Brushes.Red, 200, 10)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR&gt;End Class[/codesnippet]</description><pubDate>Mon, 16 Jul 2007 09:27:35 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10296.aspx</link><description>I think I spoke too soon. I tried to use ThemedPanel, but causes me other issues.&lt;br&gt;
For one, the base color throws everything off, even with opacity set 100.&lt;br&gt;
&lt;br&gt;
I still would like to use the gradient header, but need to find out how to make label and picture transparent.&lt;br&gt;
Thanks!</description><pubDate>Sun, 15 Jul 2007 23:24:01 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: "Gradient Form Header" question</title><link>http://forum.strataframe.net/FindPost10295.aspx</link><description>Never mind! Figured it out :)&lt;br&gt;
&lt;br&gt;
You can do really cool things with Gradation...&lt;br&gt;</description><pubDate>Sun, 15 Jul 2007 22:41:08 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item></channel></rss>