Click here to Skip to main content
15,897,704 members
Home / Discussions / C#
   

C#

 
GeneralSharing statics across AppDomains Pin
S. Senthil Kumar12-May-05 7:46
S. Senthil Kumar12-May-05 7:46 
GeneralThread Stop Exception Pin
Adnan Siddiqi12-May-05 7:19
Adnan Siddiqi12-May-05 7:19 
GeneralRe: Thread Stop Exception Pin
Daniel Grunwald12-May-05 10:14
Daniel Grunwald12-May-05 10:14 
GeneralRe: Thread Stop Exception Pin
nyjetswin200512-May-05 12:17
nyjetswin200512-May-05 12:17 
GeneralAfterLabelEdit event for listview ctl Pin
poniatow12-May-05 5:51
poniatow12-May-05 5:51 
GeneralRe: AfterLabelEdit event for listview ctl Pin
Luis Alonso Ramos12-May-05 6:08
Luis Alonso Ramos12-May-05 6:08 
GeneralRe: AfterLabelEdit event for listview ctl Pin
poniatow12-May-05 8:18
poniatow12-May-05 8:18 
GeneralRe: AfterLabelEdit event for listview ctl Pin
Anonymous12-May-05 6:34
Anonymous12-May-05 6:34 
As has been already mentioned, the reason why that happens is because the label text is set after the event.

To counter that you just need to add one more line at the end of your code:

e.CancelEdit = true;

So your new code will look like:

private void listView1_AfterLabelEdit(object sender, System.Windows.Forms.LabelEditEventArgs e)
{
string labelText;
int ItemIndex;
labelText = e.Label;
ItemIndex = e.Item;
listView1.Items[ItemIndex].Text = labelText.ToUpper();
e.CancelEdit = true;
}

--Aditya
GeneralKilling windows application Pin
mderover12-May-05 5:02
mderover12-May-05 5:02 
GeneralRe: Killing windows application Pin
Peter Vertes12-May-05 11:59
Peter Vertes12-May-05 11:59 
GeneralRe: Killing windows application Pin
Anonymous12-May-05 20:27
Anonymous12-May-05 20:27 
Generalcall c function Pin
kyfranBibax12-May-05 4:33
kyfranBibax12-May-05 4:33 
GeneralRe: call c function Pin
Judah Gabriel Himango12-May-05 4:34
sponsorJudah Gabriel Himango12-May-05 4:34 
GeneralRe: call c function Pin
kyfranBibax12-May-05 5:25
kyfranBibax12-May-05 5:25 
GeneralRetrive value of Address from xml file Pin
ksanju100012-May-05 3:01
ksanju100012-May-05 3:01 
GeneralRe: Retrive value of Address from xml file Pin
Dave Kreskowiak12-May-05 9:03
mveDave Kreskowiak12-May-05 9:03 
Generalmonitor file system Pin
s2111979212-May-05 2:17
s2111979212-May-05 2:17 
GeneralRe: monitor file system Pin
Dave Kreskowiak12-May-05 9:02
mveDave Kreskowiak12-May-05 9:02 
GeneralA Link to forum Pin
MoustafaS12-May-05 1:52
MoustafaS12-May-05 1:52 
GeneralRe: A Link to forum Pin
Colin Angus Mackay12-May-05 2:52
Colin Angus Mackay12-May-05 2:52 
Generalchange image on CrystalReport Pin
fivestart200312-May-05 1:41
fivestart200312-May-05 1:41 
GeneralGuid to intPtr Pin
Mikke_x12-May-05 1:34
Mikke_x12-May-05 1:34 
Generallistview select Pin
x-trate12-May-05 0:28
x-trate12-May-05 0:28 
GeneralRe: listview select Pin
leppie12-May-05 2:14
leppie12-May-05 2:14 
Generalreinterpret_cast in C# Pin
trannampro11-May-05 22:56
trannampro11-May-05 22:56 

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.