473,761 Members | 6,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2 colors combo for back color of Windows controls

VJ

How do I use shade effect as colors. For example when I change the backcolor
of my tab page, how do I set it to a faded 2 color combination?

VJ
Nov 20 '05 #1
3 1256
* "VJ" <vi********@yah oo.com> scripsit:
How do I use shade effect as colors. For example when I change the backcolor
of my tab page, how do I set it to a faded 2 color combination?


You will have to draw the background yourself using a
'System.Drawing .Drawing2D.Line arGradientBrush ' as brush.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
VJ
Hi.. , could you point me to some examples of doing this? I am totally new
to this graphics things..

VJ

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:2h******** ****@uni-berlin.de...
* "VJ" <vi********@yah oo.com> scripsit:
How do I use shade effect as colors. For example when I change the backcolor of my tab page, how do I set it to a faded 2 color combination?


You will have to draw the background yourself using a
'System.Drawing .Drawing2D.Line arGradientBrush ' as brush.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3
Hi,

Add Imports System.Drawing. Drawing2D to the top of your code file. In
the paint event for the tab page try something like this.

Private Sub TabPage1_Paint( ByVal sender As Object, ByVal e As
System.Windows. Forms.PaintEven tArgs) Handles TabPage1.Paint
Dim g As Graphics = e.Graphics
Dim sf As New StringFormat
Dim brText As New SolidBrush(TabP age1.ForeColor)
Dim rDraw As RectangleF

Dim br As New LinearGradientB rush(TabPage1.B ounds,
TabPage1.BackCo lor, Color.White, 90, False)

Dim bl As New Blend

bl.Factors = New Single() {0.0F, 0.1F, 0.5F, 0.7F, 0.7F, 0.5F, 0.3F,
0.2F, 0}

bl.Positions = New Single() {0, 0.1F, 0.2F, 0.5F, 0.6F, 0.7F, 0.8F,
0.9F, 1.0F}

br.Blend = bl

g.FillRectangle (br, RectangleF.op_I mplicit(TabPage 1.Bounds))
End Sub

Ken
---------------------
"VJ" <vi********@yah oo.com> wrote in message
news:eB******** ******@tk2msftn gp13.phx.gbl...
Hi.. , could you point me to some examples of doing this? I am totally new
to this graphics things..

VJ

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:2h******** ****@uni-berlin.de...
* "VJ" <vi********@yah oo.com> scripsit:
> How do I use shade effect as colors. For example when I change the backcolor > of my tab page, how do I set it to a faded 2 color combination?


You will have to draw the background yourself using a
'System.Drawing .Drawing2D.Line arGradientBrush ' as brush.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6159
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but my mappings between named colors, HEX values and the Long Integer values used in Access are not jibbing. Anyone have a nice list laying around? Danny J Lesandrini dlesandrini@hotmail.com
4
1833
by: Jozef | last post by:
Hello, I have forms in my database that use grey as the back color. When I convert them to XP, They all look goofy. The grey becomes two tone. The grey used in the controls are dark, the grey used in the form detail is light, almost white. I can change the back color on the forms to match the controls, but on controls like tabs etc, it still looks goofy (since I can't change the backcolor on a tab control or button etc.). Is there...
1
3640
by: Richard | last post by:
All, In my Windows based .NET C# application I tried to change a form's background color to non-gray. The form backround color change had the desired ripple effect for most controls on the form however it had no effect, and is a problem, for: - a TabControl {not a tabpage - the tabcontrol itself} - the scroll bars of a Datagrid
7
11145
by: Doug | last post by:
Hi I have a combo box (A) that populates a following combo box (B) based on a selection. The selection from the first combo box (A) initiates an OleDbDataAdapter routine that extracts the values for the second combo box (B) from a database. However, when I choose a value from the first combo box (A), the second combo box (B) populates as required, but if i change my mind about the selection from the first combo box (A) , the second...
5
1196
by: jcrouse | last post by:
Many of you who may respond to this are somewhat familiar with my app in process (Cor). Simply, it's a form with 30 labels that is triggered from another application, with a hotkey. The labels text is filled in by parsing a file for certain information. There is a form designer that allows the user to set many label properties of the displayed form, two of which are Label.Forecolor and Label.Backcolor. I want to try and make the form...
14
4972
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons for things like delete, save, edit, cancel buttons - in the footer, or on the form detail section? 2. If in the footer, how do you add them to the tab order?
1
1875
by: Demi | last post by:
I want to be able to define standard colors in a base form, then have child forms use those values instead of standard colors. Ex in my base form I want to do this: Color myColor = System.Drawing.SystemColors.Control; Then in my child form in the designer, I want to be able to enter "myColor" in the BackColor property.
12
4467
by: Derek Hart | last post by:
How would I list colors at runtime for System.Drawing.Color - I want to give the user a list of choices at runtime, such as System.Drawing.Color.AliceBlue (as an example of one color). I could recreate this list in a database table and pull from it, but is there a way to do this in code, to get a full list (for use in a combo, or however I want to). It would even be useful to programmatically get this list once to place it into a table. ...
3
3006
by: evenlater | last post by:
Using Access 2007, I've found that combo box back colors change to transparent from normal inconsistently for no reason I can discern. Never had that problem in previous versions of Access. I do have the back style properties set to Normal and back colors set to white, but sometimes when I tab out of a particular combo box the back color changes to match the back color of the detail section. Has anybody else had this experience? Is there...
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.