Click here to Skip to main content
15,888,086 members
Home / Discussions / C#
   

C#

 
AnswerRe: Rebooting XP programmitically Pin
PIEBALDconsult24-Aug-07 6:11
mvePIEBALDconsult24-Aug-07 6:11 
GeneralRe: Rebooting XP programmitically Pin
Dan Neely24-Aug-07 7:21
Dan Neely24-Aug-07 7:21 
GeneralRe: Rebooting XP programmitically Pin
PIEBALDconsult24-Aug-07 8:13
mvePIEBALDconsult24-Aug-07 8:13 
AnswerRe: Rebooting XP programmitically Pin
Giorgi Dalakishvili24-Aug-07 8:00
mentorGiorgi Dalakishvili24-Aug-07 8:00 
QuestionChanging ListBox items color Pin
lossy24-Aug-07 4:44
lossy24-Aug-07 4:44 
AnswerRe: Changing ListBox items color Pin
Judah Gabriel Himango24-Aug-07 4:51
sponsorJudah Gabriel Himango24-Aug-07 4:51 
GeneralRe: Changing ListBox items color Pin
lossy24-Aug-07 5:10
lossy24-Aug-07 5:10 
AnswerRe: Changing ListBox items color Pin
lossy24-Aug-07 6:05
lossy24-Aug-07 6:05 
Hello! I made it possible in the following way:
private void lstBoxSystemTypes_DrawItem(object sender, DrawItemEventArgs e)
        {
            ListBox listBox = (ListBox)sender;
            string itemValue = listBox.Items[e.Index].ToString() ;
            System.Data.DataRowView dataRowView = (System.Data.DataRowView)listBox.Items[e.Index];
                        
            e.DrawBackground();
            Brush brush = Brushes.Red;
            if (bool.Parse(dataRowView["Approved"].ToString()))
                brush = Brushes.Black;
            
            e.Graphics.DrawString(dataRowView["Name"].ToString(), e.Font, brush, e.Bounds, StringFormat.GenericDefault);
            e.DrawFocusRectangle();
        }


But there is another problem: item's color doesn't change when it is selected.
QuestionImport Data from MS Excel to DataSet using C# Pin
tuansara24-Aug-07 4:16
tuansara24-Aug-07 4:16 
AnswerRe: Import Data from MS Excel to DataSet using C# Pin
led mike24-Aug-07 4:42
led mike24-Aug-07 4:42 
QuestionImport Data from MS Excel to SQL Server 2000 Pin
tuansara24-Aug-07 4:09
tuansara24-Aug-07 4:09 
AnswerRe: Import Data from MS Excel to SQL Server 2000 Pin
Judah Gabriel Himango24-Aug-07 4:36
sponsorJudah Gabriel Himango24-Aug-07 4:36 
QuestionCreate xml file from InfoPath (xsn) file Pin
Phrone24-Aug-07 3:26
Phrone24-Aug-07 3:26 
AnswerRe: Create xml file from InfoPath (xsn) file Pin
Spacix One24-Aug-07 5:40
Spacix One24-Aug-07 5:40 
GeneralRe: Create xml file from InfoPath (xsn) file Pin
Phrone24-Aug-07 5:56
Phrone24-Aug-07 5:56 
GeneralRe: Create xml file from InfoPath (xsn) file Pin
Spacix One24-Aug-07 6:21
Spacix One24-Aug-07 6:21 
GeneralRe: Create xml file from InfoPath (xsn) file Pin
Phrone26-Aug-07 7:55
Phrone26-Aug-07 7:55 
QuestionListviews with checkboxes Pin
Hampus@foi24-Aug-07 3:17
Hampus@foi24-Aug-07 3:17 
AnswerRe: Listviews with checkboxes Pin
Alaric_24-Aug-07 3:54
professionalAlaric_24-Aug-07 3:54 
QuestionHow do I Print a web page opened with IE from external application Pin
Dinesh N Samarathunga24-Aug-07 2:33
Dinesh N Samarathunga24-Aug-07 2:33 
Question.Replace related problem Pin
KETAN.RK24-Aug-07 2:00
KETAN.RK24-Aug-07 2:00 
AnswerRe: .Replace related problem Pin
Colin Angus Mackay24-Aug-07 2:03
Colin Angus Mackay24-Aug-07 2:03 
GeneralRe: .Replace related problem Pin
KETAN.RK24-Aug-07 2:10
KETAN.RK24-Aug-07 2:10 
QuestionStrange Error Pin
AR Reddy24-Aug-07 0:18
AR Reddy24-Aug-07 0:18 
AnswerRe: Strange Error Pin
Rocky#24-Aug-07 1:22
Rocky#24-Aug-07 1:22 

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.