Click here to Skip to main content
16,004,927 members
Home / Discussions / C#
   

C#

 
GeneralRightToLeft TabControl Pin
Mikel Fayad13-Mar-05 0:35
Mikel Fayad13-Mar-05 0:35 
GeneralRe: RightToLeft TabControl Pin
Kodanda Pani13-Mar-05 18:20
Kodanda Pani13-Mar-05 18:20 
GeneralRe: RightToLeft TabControl Pin
Mikel Fayad13-Mar-05 22:03
Mikel Fayad13-Mar-05 22:03 
Generalpanel redraw problem Pin
ddeedee@hotmail.com12-Mar-05 22:30
ddeedee@hotmail.com12-Mar-05 22:30 
GeneralRe: panel redraw problem Pin
leppie12-Mar-05 22:43
leppie12-Mar-05 22:43 
GeneralDisappearing Structure Pin
gmhanna12-Mar-05 18:23
gmhanna12-Mar-05 18:23 
GeneralRe: Disappearing Structure Pin
leppie12-Mar-05 22:31
leppie12-Mar-05 22:31 
Generallistview columns Pin
ekynox12-Mar-05 17:20
ekynox12-Mar-05 17:20 
hi,

Sometime last week I had posted a messsage regarding how to change the background color of a column in a listview that a user clicks upon. I did manage to get a partial solution after viewing some sample code online. Now at the moment my solution doesnot color the entire column that the user clicks upon. The color is rather limited to the number of subitems accumulated. I have included partial code below showing the ColumnClick event. The purpose of code is to mimick a windows folder.

Is there any this code can be extended to color the entire column ?? Any suggestions will be greatly appreciated.

thanks
ekynox.

code

private void listView1_ColumnClick(object sender,
System.Windows.Forms.ColumnClickEventArgs e)
{
TheColumnSorter.CurrentColumn = e.Column;
listView1.Sort();

/*clear current selected column*/
/*7 is the number of files in c:\temp*/
for (int index = 0; index < 7;index++)
{
ListViewItem theRow = listView1.Items[index];
theRow.UseItemStyleForSubItems = false;
ListViewItem.ListViewSubItem theCell = theRow.SubItems[column_clicked_history];
theCell.BackColor = Color.White;
}
for (int index = 0; index < 7;index++)
{
ListViewItem theRow = listView1.Items[index];
theRow.UseItemStyleForSubItems = false;
ListViewItem.ListViewSubItem theCell = theRow.SubItems[e.Column];
theCell.BackColor = Color.LightGray;
}

//column_clicked_history declared as a global variable
column_clicked_history = e.Column;
}

edit: removed a redundant variable and added couple of comments in code
GeneralSystem.Diagnostics.Process() expert needed... Pin
new_phoenix12-Mar-05 16:34
new_phoenix12-Mar-05 16:34 
GeneralRe: System.Diagnostics.Process() expert needed... Pin
yoaz13-Mar-05 3:03
yoaz13-Mar-05 3:03 
Generallexical analyzer Pin
WaleedH12-Mar-05 11:52
WaleedH12-Mar-05 11:52 
GeneralRe: lexical analyzer Pin
Robert Rohde12-Mar-05 20:22
Robert Rohde12-Mar-05 20:22 
GeneralRe: lexical analyzer Pin
leppie12-Mar-05 22:49
leppie12-Mar-05 22:49 
GeneralRe: lexical analyzer Pin
WaleedH13-Mar-05 5:32
WaleedH13-Mar-05 5:32 
GeneralLogging all Incoming and Outgoing Data on specified port Pin
Gustav Paul12-Mar-05 7:49
sussGustav Paul12-Mar-05 7:49 
GeneralRe: Logging all Incoming and Outgoing Data on specified port Pin
Dave Kreskowiak12-Mar-05 17:55
mveDave Kreskowiak12-Mar-05 17:55 
Questionhow to communicate with a web site Pin
Mohsen Saad12-Mar-05 6:48
Mohsen Saad12-Mar-05 6:48 
AnswerRe: how to communicate with a web site Pin
Judah Gabriel Himango12-Mar-05 6:54
sponsorJudah Gabriel Himango12-Mar-05 6:54 
GeneralRe: how to communicate with a web site Pin
Mohsen Saad12-Mar-05 7:06
Mohsen Saad12-Mar-05 7:06 
GeneralRe: how to communicate with a web site Pin
Judah Gabriel Himango12-Mar-05 7:12
sponsorJudah Gabriel Himango12-Mar-05 7:12 
AnswerRe: how to communicate with a web site Pin
Ghazi H. Wadi12-Mar-05 7:44
Ghazi H. Wadi12-Mar-05 7:44 
AnswerRe: how to communicate with a web site Pin
Bahadir Cambel12-Mar-05 23:31
Bahadir Cambel12-Mar-05 23:31 
AnswerRe: how to communicate with a web site Pin
tonaxxl13-Mar-05 5:03
tonaxxl13-Mar-05 5:03 
GeneralRepaint frame Pin
Robske12-Mar-05 6:39
Robske12-Mar-05 6:39 
GeneralRe: Repaint frame Pin
Judah Gabriel Himango12-Mar-05 6:58
sponsorJudah Gabriel Himango12-Mar-05 6:58 

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.