Click here to Skip to main content
15,943,245 members
Home / Discussions / C#
   

C#

 
GeneralRe: about datagrid Pin
Expert Coming30-Jun-07 11:00
Expert Coming30-Jun-07 11:00 
QuestionEnumerating network printers Pin
xbiplav29-Jun-07 19:45
xbiplav29-Jun-07 19:45 
QuestionPrint rdlc without going through report viewer Pin
eccw29-Jun-07 19:23
eccw29-Jun-07 19:23 
QuestionHow to keep the user informed? Pin
Khoramdin29-Jun-07 16:24
Khoramdin29-Jun-07 16:24 
AnswerRe: How to keep the user informed? Pin
Christian Graus29-Jun-07 22:26
protectorChristian Graus29-Jun-07 22:26 
QuestionComboBox remove from index problem Pin
Rick van Woudenberg29-Jun-07 13:24
Rick van Woudenberg29-Jun-07 13:24 
AnswerRe: ComboBox remove from index problem Pin
J$29-Jun-07 14:09
J$29-Jun-07 14:09 
AnswerRe: ComboBox remove from index problem Pin
Luc Pattyn29-Jun-07 23:12
sitebuilderLuc Pattyn29-Jun-07 23:12 
So the mistake was to use square brackects; RemoveAt is a method, it needs parentheses.

Furthermore, as soon as you remove an item, all the higher-numbered items get moved
down one positition, so if you need to remove al but the first N items the correct
code would be:

for (int x = N; x < cmbtrackWhere.Items.Count; x++) {
    cmbtrackWhere.Items.RemoveAt(N);   // yes, always the first you dont want any more!
}


This loop continues to remove the first unwanted item, until there are no more unwanted
items left.

There is of course the alternative to remove them in reverse order:
for (int x = cmbtrackWhere.Items.Count-1; x>=N; x--) {
    cmbtrackWhere.Items.RemoveAt(x);
}


Of course, if you want to remove everything there is the Clear() method to do that.

Smile | :)


QuestionPrint crystal report from C# Pin
Saamir29-Jun-07 9:20
Saamir29-Jun-07 9:20 
QuestionCalling all C/C# mono devs help on freeswitch voip Pin
mrs29-Jun-07 9:01
mrs29-Jun-07 9:01 
Questionproblem with application configuration and windows startup Pin
Giorgi Dalakishvili29-Jun-07 8:52
mentorGiorgi Dalakishvili29-Jun-07 8:52 
Questionhow to open a MS word file through a label link in the application Pin
Bahaa Hany29-Jun-07 8:51
Bahaa Hany29-Jun-07 8:51 
AnswerRe: how to open a MS word file through a label link in the application Pin
Giorgi Dalakishvili29-Jun-07 8:53
mentorGiorgi Dalakishvili29-Jun-07 8:53 
GeneralRe: how to open a MS word file through a label link in the application Pin
Bahaa Hany29-Jun-07 9:26
Bahaa Hany29-Jun-07 9:26 
GeneralRe: how to open a MS word file through a label link in the application Pin
Giorgi Dalakishvili29-Jun-07 9:39
mentorGiorgi Dalakishvili29-Jun-07 9:39 
Questionencryption in C of RC4 Pin
NalBH29-Jun-07 7:35
NalBH29-Jun-07 7:35 
AnswerRe: encryption in C of RC4 Pin
Guffa29-Jun-07 8:10
Guffa29-Jun-07 8:10 
Questioncode not being executed Pin
Saamir29-Jun-07 4:20
Saamir29-Jun-07 4:20 
AnswerRe: code not being executed Pin
Luc Pattyn29-Jun-07 4:26
sitebuilderLuc Pattyn29-Jun-07 4:26 
GeneralRe: code not being executed Pin
Saamir29-Jun-07 9:17
Saamir29-Jun-07 9:17 
AnswerRe: code not being executed Pin
Not Active29-Jun-07 4:33
mentorNot Active29-Jun-07 4:33 
AnswerRe: code not being executed Pin
Guffa29-Jun-07 4:43
Guffa29-Jun-07 4:43 
GeneralRe: code not being executed Pin
Saamir29-Jun-07 5:03
Saamir29-Jun-07 5:03 
AnswerRe: code not being executed Pin
Guffa29-Jun-07 6:49
Guffa29-Jun-07 6:49 
GeneralRe: code not being executed Pin
Saamir29-Jun-07 9:16
Saamir29-Jun-07 9:16 

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.