Click here to Skip to main content
15,919,774 members
Home / Discussions / C#
   

C#

 
GeneralRe: i need help............ Pin
OriginalGriff7-Mar-15 3:55
mveOriginalGriff7-Mar-15 3:55 
GeneralRe: i need help............ Pin
Afzaal Ahmad Zeeshan7-Mar-15 3:59
professionalAfzaal Ahmad Zeeshan7-Mar-15 3:59 
GeneralRe: i need help............ Pin
manchanx7-Mar-15 4:30
professionalmanchanx7-Mar-15 4:30 
GeneralRe: i need help............ Pin
OriginalGriff7-Mar-15 4:35
mveOriginalGriff7-Mar-15 4:35 
GeneralRe: i need help............ Pin
Afzaal Ahmad Zeeshan7-Mar-15 4:41
professionalAfzaal Ahmad Zeeshan7-Mar-15 4:41 
GeneralRe: i need help............ Pin
BillWoodruff7-Mar-15 4:56
professionalBillWoodruff7-Mar-15 4:56 
GeneralRe: i need help............ Pin
OriginalGriff7-Mar-15 5:06
mveOriginalGriff7-Mar-15 5:06 
AnswerRe: i need help............ Pin
BillWoodruff7-Mar-15 5:05
professionalBillWoodruff7-Mar-15 5:05 
One comment on your use of ComboBox.SelectedIndex == 0 : if SelectedIndex is zero that indicates that the first Item in the ComboBoxItems collection is selected.

You probably want to test for -1, which indicates no selection has been made. Of course, if you know the selection index in advance at the time you present the Form to be filled out to the end-user, this is irrelevant.

Also, note that with the (WinForms) ComboBox:

"SelectedIndex, SelectedValue, and FormattingEnabled are related as follows:

If FormattingEnabled is false, SelectedIndex will not be set to -1 when SelectedValue is blank.
If FormattingEnabled is true, SelectedIndex will be set to -1 when SelectedValue is blank."

Also note: "To deselect the currently selected item, set the SelectedIndex to -1. You cannot set the SelectedIndex of a ComboBox item to -1 if the item is a data-bound item." [^]
«To kill an error's as good a service, sometimes better than, establishing new truth or fact.» Charles Darwin in "Prospero's Precepts"

QuestionHelp me, very urgent problem, about after running the program design. Pin
Member 114460806-Mar-15 16:25
Member 114460806-Mar-15 16:25 
AnswerRe: Help me, very urgent problem, about after running the program design. Pin
Dave Kreskowiak6-Mar-15 17:58
mveDave Kreskowiak6-Mar-15 17:58 
GeneralRe: Help me, very urgent problem, about after running the program design. Pin
Member 114460807-Mar-15 16:51
Member 114460807-Mar-15 16:51 
AnswerRe: Help me, very urgent problem, about after running the program design. Pin
Richard MacCutchan6-Mar-15 21:40
mveRichard MacCutchan6-Mar-15 21:40 
AnswerRe: Help me, very urgent problem, about after running the program design. Pin
OriginalGriff6-Mar-15 21:47
mveOriginalGriff6-Mar-15 21:47 
GeneralRe: Help me, very urgent problem, about after running the program design. Pin
Member 114460807-Mar-15 16:50
Member 114460807-Mar-15 16:50 
GeneralRe: Help me, very urgent problem, about after running the program design. Pin
OriginalGriff7-Mar-15 21:03
mveOriginalGriff7-Mar-15 21:03 
GeneralRe: Help me, very urgent problem, about after running the program design. Pin
phil.o7-Mar-15 8:19
professionalphil.o7-Mar-15 8:19 
QuestionNeed help changing a value in an application Pin
hopper16-Mar-15 12:11
hopper16-Mar-15 12:11 
AnswerRe: Need help changing a value in an application Pin
Richard Andrew x646-Mar-15 12:49
professionalRichard Andrew x646-Mar-15 12:49 
GeneralRe: Need help changing a value in an application Pin
manchanx6-Mar-15 12:55
professionalmanchanx6-Mar-15 12:55 
GeneralRe: Need help changing a value in an application Pin
Richard Andrew x646-Mar-15 12:56
professionalRichard Andrew x646-Mar-15 12:56 
GeneralRe: Need help changing a value in an application Pin
manchanx6-Mar-15 12:59
professionalmanchanx6-Mar-15 12:59 
GeneralRe: Need help changing a value in an application Pin
hopper16-Mar-15 13:05
hopper16-Mar-15 13:05 
GeneralRe: Need help changing a value in an application Pin
Dave Kreskowiak6-Mar-15 13:12
mveDave Kreskowiak6-Mar-15 13:12 
GeneralRe: Need help changing a value in an application Pin
hopper16-Mar-15 13:22
hopper16-Mar-15 13:22 
GeneralRe: Need help changing a value in an application Pin
Dave Kreskowiak6-Mar-15 14:44
mveDave Kreskowiak6-Mar-15 14:44 

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.