Click here to Skip to main content
15,895,746 members
Home / Discussions / C#
   

C#

 
QuestionDataBindings Save Pin
smarttom996-Mar-07 15:38
smarttom996-Mar-07 15:38 
AnswerRe: DataBindings Save Pin
sam#6-Mar-07 20:01
sam#6-Mar-07 20:01 
GeneralRe: DataBindings Save Pin
smarttom997-Mar-07 5:13
smarttom997-Mar-07 5:13 
GeneralRe: DataBindings Save Pin
smarttom997-Mar-07 5:13
smarttom997-Mar-07 5:13 
QuestionProblems with Reading Data from Serial Port (from .NET 2.0 framework) Pin
kmkimlo6-Mar-07 15:34
kmkimlo6-Mar-07 15:34 
AnswerRe: Problems with Reading Data from Serial Port (from .NET 2.0 framework) Pin
PS@Codeproj6-Mar-07 19:33
PS@Codeproj6-Mar-07 19:33 
AnswerRe: Problems with Reading Data from Serial Port (from .NET 2.0 framework) Pin
pbraun7-Mar-07 3:12
pbraun7-Mar-07 3:12 
Questionhaving user thread update listViewItem.BackColor Pin
yccheok6-Mar-07 13:46
yccheok6-Mar-07 13:46 
Hello all,

I try to have user thread to perform update on the window form list
view item back color. However, I can see the new item was added each
time. However, the back color just not changed until I move the window
around. May I noe what code I had missing out?

Thank you very much!

delegate void OnGUIDelegate(int msgID, object param1, object
param2);
public void OnGUI(int msgID, object param1, object param2)
{
// Make sure we're on the right thread
if(listView1.InvokeRequired == false)
{
switch(msgID)
{
case GUIMessage.MSG_ERR:
if(param1 is string)
{
string strDate = DateTime.Now.ToLongTimeString();
string[] s = {strDate, (string)param1};

ListViewItem listViewItem = new ListViewItem(s);
listViewItem.StateImageIndex = 2;
listViewItem.BackColor = Color.FromArgb(255, 224, 192);

listView1.Items.Add(listViewItem);
isSave = false;
}
break;

case GUIMessage.MSG_INFO:
if(param1 is string)
{
string strDate = DateTime.Now.ToLongTimeString();
string[] s = {strDate, (string)param1};

ListViewItem listViewItem = new ListViewItem(s);
listViewItem.StateImageIndex = 0;
listViewItem.BackColor = Color.FromArgb(192, 255, 192);

listView1.Items.Add(listViewItem);
isSave = false;
}
break;

case GUIMessage.MSG_WARNING:
if(param1 is string)
{
string strDate = DateTime.Now.ToLongTimeString();
string[] s = {strDate, (string)param1};

ListViewItem listViewItem = new ListViewItem(s);
listViewItem.StateImageIndex = 1;
listViewItem.BackColor = Color.FromArgb(255, 255, 192);

listView1.Items.Add(listViewItem);
isSave = false;
}
break;
} // switch
}
else
{
// Update GUI asynchronously
OnGUIDelegate onGUI =
new OnGUIDelegate(OnGUI);
this.BeginInvoke(onGUI,
new object[] { msgID, param1, param2});
}
}
Questionhow to increase the height of the Row in ListView? Pin
Khoramdin6-Mar-07 13:04
Khoramdin6-Mar-07 13:04 
AnswerRe: how to increase the height of the Row in ListView? Pin
Ravi Bhavnani6-Mar-07 17:11
professionalRavi Bhavnani6-Mar-07 17:11 
Questionaccessing a file on Local network Pin
wildpankaj6-Mar-07 12:37
wildpankaj6-Mar-07 12:37 
AnswerRe: accessing a file on Local network Pin
Ravi Bhavnani6-Mar-07 17:17
professionalRavi Bhavnani6-Mar-07 17:17 
AnswerRe: accessing a file on Local network Pin
Keshav V. Kamat6-Mar-07 17:25
Keshav V. Kamat6-Mar-07 17:25 
AnswerRe: accessing a file on Local network Pin
Keshav V. Kamat6-Mar-07 17:32
Keshav V. Kamat6-Mar-07 17:32 
Questionsystem.diagnostics.process help Pin
JMichael24686-Mar-07 11:57
JMichael24686-Mar-07 11:57 
AnswerRe: system.diagnostics.process help Pin
Dave Kreskowiak6-Mar-07 17:18
mveDave Kreskowiak6-Mar-07 17:18 
GeneralRe: system.diagnostics.process help Pin
JMichael24687-Mar-07 2:55
JMichael24687-Mar-07 2:55 
GeneralRe: system.diagnostics.process help Pin
Dave Kreskowiak7-Mar-07 12:44
mveDave Kreskowiak7-Mar-07 12:44 
GeneralRe: system.diagnostics.process help Pin
JMichael24688-Mar-07 3:48
JMichael24688-Mar-07 3:48 
AnswerRe: system.diagnostics.process help Pin
Ravi Bhavnani6-Mar-07 17:20
professionalRavi Bhavnani6-Mar-07 17:20 
GeneralRe: system.diagnostics.process help Pin
JMichael24687-Mar-07 4:10
JMichael24687-Mar-07 4:10 
QuestionImage in DataGridView Pin
Nooie6-Mar-07 11:21
Nooie6-Mar-07 11:21 
QuestionRetrieving Pin
hadad6-Mar-07 11:20
hadad6-Mar-07 11:20 
AnswerRe: Retrieving Pin
Guffa6-Mar-07 13:35
Guffa6-Mar-07 13:35 
Questiondraw finest dot on the screen..... Pin
samreengr86-Mar-07 11:09
samreengr86-Mar-07 11:09 

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.