Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
QuestionHow to make a new MDI child form maximum size? Pin
fantasy121510-Apr-12 15:42
fantasy121510-Apr-12 15:42 
AnswerRe: How to make a new MDI child form maximum size? Pin
Karthik Harve10-Apr-12 18:17
professionalKarthik Harve10-Apr-12 18:17 
GeneralRe: How to make a new MDI child form maximum size? Pin
fantasy121510-Apr-12 22:56
fantasy121510-Apr-12 22:56 
QuestionList Box Sudden Exit On Selection Pin
PDTUM10-Apr-12 13:33
PDTUM10-Apr-12 13:33 
AnswerRe: List Box Sudden Exit On Selection Pin
Richard Andrew x6410-Apr-12 14:01
professionalRichard Andrew x6410-Apr-12 14:01 
AnswerRe: List Box Sudden Exit On Selection Pin
Luc Pattyn10-Apr-12 15:35
sitebuilderLuc Pattyn10-Apr-12 15:35 
AnswerRe: List Box Sudden Exit On Selection Pin
PDTUM11-Apr-12 5:52
PDTUM11-Apr-12 5:52 
AnswerRe: List Box Sudden Exit On Selection Pin
BobJanova10-Apr-12 23:21
BobJanova10-Apr-12 23:21 
My guess is you're doing SelectedItem.something in the event handler. If you select nothing, SelectedItem will be null, and SelectedIndex will be -1. You should always check for these conditions in any event handler that uses one of these properties; I typically put a guard at the top, since you usually don't want to do anything in that case:

void ListSelectionChanged(object sender, EventArgs e){
 ListControl list = (ListControl)sender;
 if(list.SelectedIndex < 0) return;
 ... // do stuff with list.SelectedItem
}

QuestionC# App to/from MetaTrader 4 Pin
iltallman10-Apr-12 12:28
iltallman10-Apr-12 12:28 
QuestionHow I can isolate a Keyboard in the operative system? Pin
tsw198510-Apr-12 7:49
tsw198510-Apr-12 7:49 
AnswerRe: How I can isolate a Keyboard in the operative system? Pin
Dave Kreskowiak10-Apr-12 8:11
mveDave Kreskowiak10-Apr-12 8:11 
GeneralRe: How I can isolate a Keyboard in the operative system? Pin
tsw198510-Apr-12 10:05
tsw198510-Apr-12 10:05 
GeneralRe: How I can isolate a Keyboard in the operative system? Pin
Dave Kreskowiak10-Apr-12 10:24
mveDave Kreskowiak10-Apr-12 10:24 
GeneralRe: How I can isolate a Keyboard in the operative system? Pin
tsw198510-Apr-12 10:45
tsw198510-Apr-12 10:45 
GeneralRe: How I can isolate a Keyboard in the operative system? Pin
PIEBALDconsult10-Apr-12 11:37
mvePIEBALDconsult10-Apr-12 11:37 
GeneralRe: How I can isolate a Keyboard in the operative system? Pin
Dave Kreskowiak10-Apr-12 14:21
mveDave Kreskowiak10-Apr-12 14:21 
GeneralRe: How I can isolate a Keyboard in the operative system? Pin
tsw198511-Apr-12 1:17
tsw198511-Apr-12 1:17 
AnswerRe: How I can isolate a Keyboard in the operative system? Pin
jschell10-Apr-12 8:32
jschell10-Apr-12 8:32 
AnswerRe: How I can isolate a Keyboard in the operative system? Pin
PIEBALDconsult10-Apr-12 10:40
mvePIEBALDconsult10-Apr-12 10:40 
QuestionSend SMS using GSM modem Pin
zakirox12310-Apr-12 5:50
zakirox12310-Apr-12 5:50 
AnswerRe: Send SMS using GSM modem Pin
kevinnicol10-Apr-12 6:33
kevinnicol10-Apr-12 6:33 
Questionc# calling Stored Procedures Pin
si_6910-Apr-12 5:39
si_6910-Apr-12 5:39 
AnswerRe: c# calling Stored Procedures Pin
Pete O'Hanlon10-Apr-12 5:47
mvePete O'Hanlon10-Apr-12 5:47 
AnswerRe: c# calling Stored Procedures Pin
jschell10-Apr-12 8:36
jschell10-Apr-12 8:36 
AnswerRe: c# calling Stored Procedures Pin
PIEBALDconsult10-Apr-12 10:04
mvePIEBALDconsult10-Apr-12 10:04 

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.