Display Color Hex Values in a DropDownList

How can I populate a DropDownList with the Available Color Hex Values
while displaying the Color?  I'd like to allow my users a way to set a
color profile.

Thanks
0
Dave
3/21/2010 2:02:06 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

3 Replies
942 Views

Similar Articles

[PageSpeed] 25

Hello,

The problem being exactly ? Is this to get the hex values or to display a 
color for each item or to enumerate available colors ?

You also have ColorDialog 
(http://msdn.microsoft.com/en-us/library/system.windows.forms.colordialog.aspx)...

--
Patrice


"Dave" <Dave.Burkett@Jacobs.com> a �crit dans le message de 
news:f8e3e0b5-1b54-49b4-85db-079e8ea7d2bf@19g2000yqu.googlegroups.com...
> How can I populate a DropDownList with the Available Color Hex Values
> while displaying the Color?  I'd like to allow my users a way to set a
> color profile.
>
> Thanks 

0
Patrice
3/21/2010 4:41:25 PM
Sorry Patrice, this is a web page.  My intention is to display the
color as forecolor with the hex value as the value of the dropdown.





On Mar 21, 11:41=A0am, "Patrice" <http://scribe-en.blogspot.com/> wrote:
> Hello,
>
> The problem being exactly ? Is this to get the hex values or to display a
> color for each item or to enumerate available colors ?
>
> You also have ColorDialog
> (http://msdn.microsoft.com/en-us/library/system.windows.forms.colordia...=
)...
>
> --
> Patrice
>
> "Dave" <Dave.Burk...@Jacobs.com> a crit dans le message denews:f8e3e0b5-1=
b54-49b4-85db-079e8ea7d2bf@19g2000yqu.googlegroups.com...
>
>
>
> > How can I populate a DropDownList with the Available Color Hex Values
> > while displaying the Color? =A0I'd like to allow my users a way to set =
a
> > color profile.
>
> > Thanks- Hide quoted text -
>
> - Show quoted text -

0
Dave
3/22/2010 10:21:42 AM
> Sorry Patrice, this is a web page.  My intention is to display the
> color as forecolor with the hex value as the value of the dropdown.

Could give something such as :

    Color[] colors={System.Drawing.Color.Red,System.Drawing.Color.Green};
            foreach(Color color in colors)
            {
                ListItem li=new ListItem();
                li.Attributes.Add("style","color:#"+String.Format("{0:x}",color.ToArgb()).Substring(2));
                li.Text=String.Format("{0:X}",color.ToArgb()).Substring(2);
                li.Value = li.Text;
                ddl.Items.Add(li);
            }

ddl being an ASP.NET DropDownList...

You can use the a 0:X placeholder to convert a value to an hexa value (I use 
Substring to keep only RGB values and drop the Alpha component). Using the 
Attributes collection, you can add the appropriate style to set the color 
even if the ListItem class has no explicit properties for this...

--
Patrice 

0
Patrice
3/22/2010 10:55:06 AM
Reply:

Similar Artilces:

how do i change the default value of measure from points to inche.
how do i change the default value of measure from points to inches when setting the width and hight of cells? You don't. Excel uses only points for these measures best wishes -- Bernard Liengme www.stfx.ca/people/bliengme remove CAPS in email address "yoyo4u" <yoyo4u@discussions.microsoft.com> wrote in message news:33420157-6E05-4A55-9003-088D731E495E@microsoft.com... > how do i change the default value of measure from points to inches when > setting the width and hight of cells? yoyo Row heights are measured in points. There are 72 points to an inch. Th...

Chart to show Portfolio Value over time?
I'm using Money 2003. I would like to be able to see the $ value I have in my portfolio over time. So that I can weep. Money does have a chart view that allows you to see the PRICE history for a given stock over time - but not the dollar value of your investment in the stock over time. In fact, I can't seem to find a view at all that shows you the net value of your portfolio/individual stocks changing over time. The best I've been able to do is to use the "Net Worth" report and unselect all the other accounts. This has insufficient granularity (months instea...

Dialog displayed
Hi I'm creating a dialog and calling it with domodal(). Is there a message handler or something insode my dialogclass that is called after the dialog is displayed? Thanks Urban Yes & No. Take a look at the OnInitDialog() message handler. OnInitDialog() gets called before the dialog is displayed. However you can post a user-defined message to yourself from the OnInitDialog() handler, and handle things that you want to do after the dialog is displayed. -- Cheers Check Abdoul [ VC++ MVP ] ----------------------------------- "Urban Stadler" <mail@ustadler....

how do I display email addresses memorized by autocomplete?
I have many email addresses that autocomplete has memorized, but that have not been entered into my contacts, that I would like to access. Any ideas? This is a great tool for it: http://www.nirsoft.net/utils/outlook_nk2_autocomplete.html -- Ricardo Silva Add-ins for Microsoft(c) Outlook(c) http://www.rsoutlook.com/us/products.html "alyankee" <alyankee@discussions.microsoft.com> wrote in message news:09CC2496-662A-4919-904C-EF6D93A51033@microsoft.com... >I have many email addresses that autocomplete has memorized, but that have > not been entered i...

Insert empty numeric value
Dear all, In VB, I have three textbox which are amount1,amount2 and amount3. After user enter the value in the textbox, I will insert the value into Access table. The table have three columns amount1 , amount2 and amount3, and all are nummeric Type. However, if the user do not enter any value in textbox . The insert statement will become as follows: Insert into table1 (amount1,amount2,amount3) values (,,) Then access complain that there is syntax error in insert statement. Does that mean I cannot insert empty value for the numeric value in access.? How to solve this problem. Than...

Subtracting value from main form
I have a borrow module which will alow user to return item separately. So, I have get the structure of returning it separately. In my main form is the borrowing item, with the loaned quantity and the owed quantity (will be calculated). In the subform, there is the returning transaction. User will need to key in the quantity returned and it will be automatically deducted from the quantity owed. But how am I supposed to get the quantity deducted while it 1 is in main form and the other is in subform? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-fo...

How do I find a value on a line?
I made a line graph of data to use as a calibration. I know the y value and I want to find the X value. Is there a way that I find find this specifically on the line without using a trendline formula or guessing by looking at the gridlines? The only way to find a specific value is to use the formula. Rgs, Bou If you can accept piece-wise linear interpolation, see Interactive Chart http://www.tushar- mehta.com/excel/software/interactive_chart_display/index.html -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity s...

Replace null value with the previous value?
I have a database that was just imported that has approximately 388000 records. The problem is that there is information about a person in multiple different records but the name did not come across with each record. (So I have 10 records with information for a certain name, but the name only appears in field 1 of the first record and not the subsequent 9, etc.) I need to create a query or expression that will fill field 1 with the preceding value if it is null. This way I will have all the information for field 1 in a manner that I can link and combine data. Simply I need to fil...

Calculating values for empty cells.
Hello. I have a very simple problem that I cannot find the answer to. I have data in two columns, some of the data in one of the columns is missing and I want to automatically extrapolate what the data should be based on the trend. How can I get Excel to fill in empty values without overwriting the known values. Below is a sample of my data. 1500 1600 1700 1800 4000 1887 5700 1900 5500 1910 7300 1912 8100 1920 8800 1926 10100 1930 11900 1936 12200 1938 -- Ryan Taylor rtaylor@stgeorgeconsulting.com Not sure what yo...

Default value for custom field?
How can I populate a custom field with a default value? Specifically, I have a custom field "DisplayName" associated with the Quote Detail object. I want initially to populate this field with the value of the product name field when a new product is added to a quote. The user can then edit the DisplayName custom field if desired. The DisplayName custom field will be used as the product name on a Crystal Reports quote form. ...

How to change the color of CComboBoxEx
I have derived my class from CComboBoxEx and I change the colors (SetBkColor and SetTextColor) in OnCtlColor() in response to CTLCOLOR_EDIT and CTLCOLOR_LISTBOX; I also return my brush; As a result the colors of the edit part of the combo do change but in the listbox only the space around the text is painted. The text itself and its backgound remain as the Windows defaults. "David A. Mair" <mairda@hotrmail.com> wrote in message news:<ObKF5Q#bDHA.2632@TK2MSFTNGP12.phx.gbl>... > I have it working OK, here's my CColorComboBox::OnCtlColor(): > > HBRUSH CColorCo...

visited links no longer change color
The links still work when clicked but, no longer show purple when visited. This happens in both Outlook and Outlook Express. Yesterday I tried making fonts a little larger as I have eyesight problem. Not sure if this is when the link color problem started. What I did exactly is: *Tools > Options > Mail Format > click "Fonts" button > click "International Fonts" button * At first I went through the list making each one "Larger" font size. * I realized that it's probably only "Western European" I need to change, so all others were set ...

message does not display on in-coming mail
in outlook express, for in-coming mail, i see the sender, attachments and subject but the space for the message is blank. any suggestions Try posting this in an Outlook Express news group - this is not one of them. Outlook is a part of Microsoft Office and is what this group supports. Outlook Express is a part of Internet Explorer and has its own news groups. You can also find some good Outlook Express information here: http://insideoe.tomsterdam.com --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here...

How do I get a chart to display backwards/forwards?
I have stock data. Row 35 is the nearest day. Row 36 is the next day, etc. When I chart the data using a 2 axes chart (custom), the chart doesn't display backwards. The nearest day displays on the left side of the chart, not the right. How do I change that? Double click on the axis, select the scale tab, and check "Values in reverse order" Jerry Will wrote: > I have stock data. Row 35 is the nearest day. Row 36 is the next day, etc. > When I chart the data using a 2 axes chart (custom), the chart doesn't > display backwards. The nearest day displays on the ...

Limit value for Storage Groups
Hello, we are running Exchange 2003 Standard edition. The limitation on Storage Groups for e.g. "Issue warning at(KB)" is default set by 2097151. I read that i can change this value by using ADSI Edit and edit the values mDBOverHardQuotaLimit mDBOverQuotaLimit mDBStorageQuota But each of them has a lots of values and i could not find out which one i have to edit. Could you please give me an advice? TIA helpi If you want to set a value bigger than 2GB for all users on an entire mailbox store, bring up the properties of that mailbox store in ADSIEdit and set the mDBStorageQuot...

custom report not showing values
I have uploaded a very simple SRS report that includes "out of box fields" and custom fields. When I run the report, instead of my custom field values showing in the report, I get the id of the value. What am I missing? -Melissa ...

Display various currencies in Account listings
Anyone have a solution that makes sense, I would liek to simply list the correct currencies according to the Accounts. Example: I use a Foriegn Bank, the local currency is Euros, I also use my Home Bank which uses Dollars. When I do a listing of the Accounts, I get a display of all amounts in Dollars or Euros and would like to see both. Working abroad! therefore; it would be nice to acutally see what is what. Or should I see Microsoft as on a one track mine set, that it only happens in America! if you have any supportive info please let me know. Thanks in advance ...

Extract Values from a Column
I have a worksheet used to track time spent on various jobs. One column is for the JOB # while others are for descriptions, etc. I would like to have formulas or possible a macro (if necessary) to sum the time spent on different jobs. For example, say (for simplicity) that each row is equal to 1 unit of time. Then in this row I put 342 for JOB # 342. After the entire day I have worked on say 5 different jobs. I would like to have a cell that says "Total time spent on Job # 342" and then next to it a formula that would look at the column and count all the values that are equal t...

Value shading map issue
I am creating a map in Excel using MS Map to show a US map. When using the value shading function, I can't figure out how to keep the states that have no values blank. What happens is the key shows a range of values (0- 10, 11-20). I need the states that have NO value to have their own color (or lack of color) and I am not sure how to do this... Any suggestions? Chris In your data, you could calculate the state name in a new column, and use the calculated name in the map. For example, if state names are in column D, and values are in column E: =IF(E2=0,"",D2) Th...

Help: Seting the value of another cell with a formula
I know that there's a way to make a cell a particular value based on the entries of a range, or array of cells, but is it possible to do the reverse, using only one formula in a cell. Here's what I'm trying to do: What I would like to do is set one of a range of cell to have a value based on the value in A2. Example: Cell A1 has a value of 2, A2 has a value of 2007. I want A10 to equal A1, i.e.:2 Cell A1 has a value of 2, A2 has a value of 2008. I want A11 to equal A1, i.e.:2 Cell A1 has a value of 2, A2 has a value of 2009. I want A12 to equal...

averages without including zero values
={AVERAGE(IF(J7:J21<>0, J7:J21,""))} Trying to use a array formula similar to the above to calculate an average of numbers from a column without including zero value fields in the average. but I am not successful. Any ideas -- lighting ------------------------------------------------------------------------ lighting's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29656 View this thread: http://www.excelforum.com/showthread.php?threadid=493664 Hi Lightning, The Average function ignores empty cells, so try: = Average(J7:J21) --- R...

Extract from a table a value by interpolating
Hi, I'm a new with fancy things in excell and would very much appreciate the help. I have a table from which I want to extract values, but I want those values to be interpolated from what is in the table. How can I do that? Thanks, Maria hi, this is how i do it. Lets say your table is at A12 to B20 make another column at column C with this equaition =(B14-B13)/(A14-A13) A B C 12 2.000 1.000 0.5 13 4.000 2.000 1.0 14 6.000 4.000 1.0 15 8.000 6.000 1.0 16 10.000 8.000 1.0 17 12.000 10.000 1.0 18 14.000 12.000 1.0 19 16.000 14.00...

Conditionally formatting a cell based on other cell values
I am trying to format a cell based upon the relationship of another cell to a reference value. For instance if the reference is 5 and the other cell is 4 I want to format the original cell green, if it is the same blue and if it is less than the reference red. Can someone help please! Please give a full explanation -- Russell Dawson Excel Student Please hit "Yes" if this post was helpful. "ian" wrote: > I am trying to format a cell based upon the relationship of another cell to a > reference value. For instance if the reference is 5 and t...

Value copied based on choosen value from combo box
I do have two sheets SheetA and SheetB SheetA 111 100 222 200 333 300 444 400 SheetB Consists of combo box for 1st column. After choosing value, the corresponding value in the neighboring column from sheetA is copied. 333 X 222 X 444 X Sample: 444 400 What is the formula is the X cells, it should be with MATCH or COUNT / COUNTIF but I cannot get the right formula. Bart Excel 2003 How to have a value being copied to another sheet? Hi One way, in cell B2 of Sheet2 =VLOOKUP(A2,Sheet1!$A$1;$B$100,2,0) copy down as far as required. Change the range A1:B100 to includ...

Using the returned value of a function
I am trying to have a value automatically enetered into a range of cells if the date at the top of the column matches today's date. I have tried using the "Today()" and "IF" functions with no luck. adombrowski Wrote: > I am trying to have a value automatically enetered into a range of cell > if > the date at the top of the column matches today's date. I have trie > using > the "Today()" and "IF" functions with no luck. Hi adombrowski Assuming the the date to be in cell A1, try this =IF(A1=TODAY(),1,0) this will return the ...