Click here to Skip to main content
15,884,177 members
Home / Discussions / C#
   

C#

 
AnswerRe: Office Development problems Pin
Matt T Heffron26-Feb-13 11:58
professionalMatt T Heffron26-Feb-13 11:58 
AnswerRe: Office Development problems Pin
Jegan Thiyagesan27-Feb-13 5:04
Jegan Thiyagesan27-Feb-13 5:04 
GeneralRe: Office Development problems Pin
Matt T Heffron27-Feb-13 9:32
professionalMatt T Heffron27-Feb-13 9:32 
GeneralRe: Office Development problems Pin
Jegan Thiyagesan27-Feb-13 11:57
Jegan Thiyagesan27-Feb-13 11:57 
QuestionTab Delimited file to sql database Pin
gavindon26-Feb-13 10:03
gavindon26-Feb-13 10:03 
AnswerRe: Tab Delimited file to sql database Pin
Matt T Heffron26-Feb-13 10:27
professionalMatt T Heffron26-Feb-13 10:27 
GeneralRe: Tab Delimited file to sql database Pin
gavindon26-Feb-13 11:25
gavindon26-Feb-13 11:25 
QuestionListbox colours. Pin
Septimus Hedgehog26-Feb-13 7:35
Septimus Hedgehog26-Feb-13 7:35 
I've implemented owner drawing when adding items to a listbox. I won't waste time going into it but where I have hit a problem is with colours. Our application will read a column containing an ARGB value for a colour. This value is put into the Color.FromArgb method which returns a Color object which is then applied to the listbox value. If I use exclusively named colours like Color.Red, Color.LimeGreen that sort of thing the listbox is drawn 100% fine. But if the ARGB value isn't a named colour it fails to render anything. It effectively leaves me with white text on a white background.

Has anyone used other than named colours when painting listbox items using OwnerDrawVariable?

As I say, it works perfectly for named colours but the moment I use an ARGB value which isn't a named colour it doesn't actually do anything.

There is a method in the graphics object called GetNearestColor. I tried pumping my ARGB value into it but the Color object it emits is exactly the same as what I sent it. In other words, it doesn't convert a colour that's approximately "slightly like fuschia" for example into Fuschia which is what GetNearestColor is supposed to do. The colour that's in the database is selected by users with the colour picker dialog and they can select any colour or pick one of their own.

Curiously, the same ARGB value works perfectly in a Treeview control.

Any ideas?
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).

AnswerRe: Listbox colours. Pin
Alan N26-Feb-13 8:40
Alan N26-Feb-13 8:40 
AnswerRe: Listbox colours. Pin
Dave Kreskowiak26-Feb-13 9:05
mveDave Kreskowiak26-Feb-13 9:05 
GeneralRe: Listbox colours. Pin
Septimus Hedgehog26-Feb-13 22:59
Septimus Hedgehog26-Feb-13 22:59 
GeneralRe: Listbox colours. Pin
Dave Kreskowiak27-Feb-13 1:01
mveDave Kreskowiak27-Feb-13 1:01 
GeneralRe: Listbox colours. Pin
Septimus Hedgehog27-Feb-13 5:39
Septimus Hedgehog27-Feb-13 5:39 
Questioncan floats be multiplied and come up with a fraction? Pin
notahack26-Feb-13 6:01
notahack26-Feb-13 6:01 
AnswerRe: can floats be multiplied and come up with a fraction? Pin
Richard Deeming26-Feb-13 6:15
mveRichard Deeming26-Feb-13 6:15 
AnswerRe: can floats be multiplied and come up with a fraction? Pin
Richard MacCutchan26-Feb-13 6:26
mveRichard MacCutchan26-Feb-13 6:26 
AnswerRe: can floats be multiplied and come up with a fraction? Pin
notahack26-Feb-13 6:35
notahack26-Feb-13 6:35 
GeneralRe: can floats be multiplied and come up with a fraction? Pin
Richard Deeming26-Feb-13 7:39
mveRichard Deeming26-Feb-13 7:39 
GeneralRe: can floats be multiplied and come up with a fraction? Pin
notahack26-Feb-13 7:44
notahack26-Feb-13 7:44 
GeneralRe: can floats be multiplied and come up with a fraction? Pin
Richard Deeming26-Feb-13 8:03
mveRichard Deeming26-Feb-13 8:03 
GeneralRe: can floats be multiplied and come up with a fraction? Pin
notahack26-Feb-13 8:13
notahack26-Feb-13 8:13 
GeneralRe: can floats be multiplied and come up with a fraction? Pin
Dave Kreskowiak26-Feb-13 9:03
mveDave Kreskowiak26-Feb-13 9:03 
GeneralRe: can floats be multiplied and come up with a fraction? Pin
Dave Kreskowiak26-Feb-13 8:58
mveDave Kreskowiak26-Feb-13 8:58 
QuestionC# EF5 List<ENum> Persisting ? Pin
Khorne26-Feb-13 4:01
Khorne26-Feb-13 4:01 
AnswerRe: C# EF5 List<ENum> Persisting ? Pin
Ssyxz26-Feb-13 15:14
Ssyxz26-Feb-13 15:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.