Click here to Skip to main content
15,914,016 members
Home / Discussions / C#
   

C#

 
QuestionC# Datagrid painting Pin
Ashish_Sood27-Aug-06 21:48
Ashish_Sood27-Aug-06 21:48 
Questioncheck if user (by sid) is member of group (by sid) Pin
Goerlandt27-Aug-06 21:14
Goerlandt27-Aug-06 21:14 
QuestionListview.SelectedItems Pin
Sri harini27-Aug-06 21:07
Sri harini27-Aug-06 21:07 
AnswerRe: Listview.SelectedItems Pin
Nader Elshehabi28-Aug-06 2:48
Nader Elshehabi28-Aug-06 2:48 
GeneralRe: Listview.SelectedItems Pin
Sri harini28-Aug-06 16:51
Sri harini28-Aug-06 16:51 
GeneralRe: Listview.SelectedItems Pin
Nader Elshehabi28-Aug-06 19:13
Nader Elshehabi28-Aug-06 19:13 
GeneralRe: Listview.SelectedItems Pin
Sri harini28-Aug-06 21:30
Sri harini28-Aug-06 21:30 
AnswerRe: Listview.SelectedItems Pin
Nader Elshehabi29-Aug-06 3:37
Nader Elshehabi29-Aug-06 3:37 
Hello

What I understand from your post is that you want to append some text at the end of each selected item in the listView.

First, let's we go through your code:

Sri harini wrote:
listView3.SelectedIndices = new Font("Arial", 10, FontStyle.Bold);

Here you are assigning a font object to a collection of integers!! Not appropriate.

Sri harini wrote:
listView3.Items.Add(name + " : " +message);

Assuming that message is a string, you are trying to add a string to a collection of ListViewItems! Again same problem

The last line is same as the second. So, your problem lies in not matching your types. You must know which type to use. Usually I keep my MSDN as long as I'm programming. It helps a lotBig Grin | :-D

Now to do the same thing, I suggest this code:

foreach(int Index in listView3.SelectedIndices)
    listView3.Items[Index].Text += ": " + message; //+ "\n";


You can't change the font of items because it's not supported in compact framework -BTW: I revised MSDN for that;P-

I don't understand why would you add a newline to the end of your item's text?? But if you insist just uncomment the code I commented -after removing the semicolon of course-

RegardsRose | [Rose]

QuestionAdding a file to solution explorer using Add-Ins [modified] Pin
Phanindra Kumar27-Aug-06 20:28
Phanindra Kumar27-Aug-06 20:28 
AnswerRe: Adding a file to solution explorer using Add-Ins Pin
Nader Elshehabi28-Aug-06 2:52
Nader Elshehabi28-Aug-06 2:52 
QuestionMetafile (wmf/emf) manipulation help needed Pin
kunaalmalhotra27-Aug-06 20:02
kunaalmalhotra27-Aug-06 20:02 
QuestionAbout Webpage Setting Pin
Ahmad Zia Quaiser27-Aug-06 19:19
Ahmad Zia Quaiser27-Aug-06 19:19 
AnswerRe: About Webpage Setting Pin
Guffa27-Aug-06 23:24
Guffa27-Aug-06 23:24 
AnswerRe: About Webpage Setting Pin
Nader Elshehabi28-Aug-06 1:25
Nader Elshehabi28-Aug-06 1:25 
QuestionAbout Webpage Setting Pin
Ahmad Zia Quaiser27-Aug-06 19:18
Ahmad Zia Quaiser27-Aug-06 19:18 
AnswerRe: About Webpage Setting Pin
jithen_dt28-Aug-06 1:28
jithen_dt28-Aug-06 1:28 
QuestionA question about maskedTextBox control Pin
mariodai36527-Aug-06 15:17
mariodai36527-Aug-06 15:17 
AnswerRe: A question about maskedTextBox control Pin
Nader Elshehabi27-Aug-06 15:27
Nader Elshehabi27-Aug-06 15:27 
GeneralRe: A question about maskedTextBox control Pin
mariodai36527-Aug-06 15:40
mariodai36527-Aug-06 15:40 
GeneralRe: A question about maskedTextBox control Pin
Nader Elshehabi27-Aug-06 16:12
Nader Elshehabi27-Aug-06 16:12 
GeneralRe: A question about maskedTextBox control Pin
Ed.Poore27-Aug-06 22:05
Ed.Poore27-Aug-06 22:05 
GeneralRe: A question about maskedTextBox control Pin
Nader Elshehabi28-Aug-06 0:58
Nader Elshehabi28-Aug-06 0:58 
Questionmouse cursor Pin
TAREQ F ABUZUHRI27-Aug-06 13:59
TAREQ F ABUZUHRI27-Aug-06 13:59 
AnswerRe: mouse cursor Pin
Nader Elshehabi27-Aug-06 14:29
Nader Elshehabi27-Aug-06 14:29 
QuestionHow to get URL on the screen?please.. Pin
zhoujun27-Aug-06 13:03
zhoujun27-Aug-06 13:03 

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.