Click here to Skip to main content
15,905,912 members
Home / Discussions / C#
   

C#

 
Questionhow to set windows system time with C# Pin
dexom26-Feb-06 23:08
dexom26-Feb-06 23:08 
AnswerRe: how to set windows system time with C# Pin
mav.northwind26-Feb-06 23:58
mav.northwind26-Feb-06 23:58 
QuestionDyanamic size of Array Pin
cshivaprasad26-Feb-06 22:52
cshivaprasad26-Feb-06 22:52 
AnswerRe: Dyanamic size of Array Pin
Corinna John26-Feb-06 22:59
Corinna John26-Feb-06 22:59 
AnswerRe: Dyanamic size of Array Pin
Guffa26-Feb-06 23:23
Guffa26-Feb-06 23:23 
QuestionMenus overloads CPU Pin
magja26-Feb-06 22:39
magja26-Feb-06 22:39 
QuestionListview Not Disabling Properly Pin
redfish3426-Feb-06 22:15
redfish3426-Feb-06 22:15 
AnswerFound Simple Solution Pin
redfish3426-Feb-06 23:10
redfish3426-Feb-06 23:10 
Since this listview is not anticipated to hold more than a few dozen items, i simply made a function that took each item icon, converted it to disable, and then put it back. Performance is very satisfactory. Below is my code. Since i had another routine that gets the icons, i did not code the conversion of disabled ==> enabled. For the in-place image converting i used code gotten from a code project article.

private void WinListEnabled(bool enabled)
{
// winlist listview
// normal disable does not color background properly
// and images maintain full color and do not gray;
// so workaround must be used;

if (enabled == true)
{
this.lvwWindowList.Enabled = true;
this.lvwWindowList.BackColor = SystemColors.Window;
this.lvwWindowList.ForeColor = SystemColors.WindowText;
LoadWinList();
}
else
{
this.lvwWindowList.Enabled = false;
this.lvwWindowList.BackColor = SystemColors.ControlLight;
this.lvwWindowList.ForeColor = SystemColors.GrayText;

for (int i = 0; i < this.lvwWindowList.Items.Count; i++)
{
// get item icon
ListViewItem listItem = this.lvwWindowList.Items[i];
Image itemIcon = this.imlWinIcons.Images[listItem.ImageIndex];

// create disabled image
Bitmap active = new Bitmap(itemIcon);
Bitmap disable = new Bitmap(active.Width, active.Height);
Graphics g = Graphics.FromImage(disable);
g.DrawImage(active, 0, 0);
ControlPaint.DrawImageDisabled(g, active, 0, 0, Color.Empty);
g.Dispose();

// replace listview image
this.imlWinIcons.Images[listItem.ImageIndex] = disable;
}
}
}
QuestionOpen File Dialog Pin
Dave McCool26-Feb-06 22:06
Dave McCool26-Feb-06 22:06 
AnswerRe: Open File Dialog Pin
J4amieC26-Feb-06 22:31
J4amieC26-Feb-06 22:31 
AnswerRe: Open File Dialog Pin
mav.northwind27-Feb-06 7:58
mav.northwind27-Feb-06 7:58 
QuestionCompute DataTable Columns Pin
myNameIsRon26-Feb-06 21:50
myNameIsRon26-Feb-06 21:50 
Questiondatarow edit Pin
fmardani26-Feb-06 20:57
fmardani26-Feb-06 20:57 
QuestionGetting control focus Pin
NewbieDude26-Feb-06 20:52
NewbieDude26-Feb-06 20:52 
Questionnormal fast way to determine control global position? Pin
Oskars26-Feb-06 20:23
Oskars26-Feb-06 20:23 
AnswerRe: normal fast way to determine control global position? Pin
microsoc26-Feb-06 22:17
microsoc26-Feb-06 22:17 
QuestionDisposing of Tray Icon Pin
Expert Coming26-Feb-06 19:33
Expert Coming26-Feb-06 19:33 
AnswerRe: Disposing of Tray Icon Pin
redfish3426-Feb-06 22:23
redfish3426-Feb-06 22:23 
QuestionAssembly have been signed but not protecting URGENT Pin
Ariston Darmayuda26-Feb-06 15:07
Ariston Darmayuda26-Feb-06 15:07 
AnswerRe: Assembly have been signed but not protecting URGENT Pin
mav.northwind27-Feb-06 7:51
mav.northwind27-Feb-06 7:51 
QuestionRe: Assembly have been signed but not protecting URGENT Pin
Ariston Darmayuda27-Feb-06 18:42
Ariston Darmayuda27-Feb-06 18:42 
AnswerRe: Assembly have been signed but not protecting URGENT Pin
mav.northwind27-Feb-06 20:20
mav.northwind27-Feb-06 20:20 
GeneralRe: Assembly have been signed but not protecting URGENT Pin
Ariston Darmayuda28-Feb-06 5:32
Ariston Darmayuda28-Feb-06 5:32 
GeneralRe: Assembly have been signed but not protecting URGENT Pin
mav.northwind28-Feb-06 6:45
mav.northwind28-Feb-06 6:45 
QuestionGetting C++ ready for .NET interop Pin
Judah Gabriel Himango26-Feb-06 14:53
sponsorJudah Gabriel Himango26-Feb-06 14:53 

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.