Click here to Skip to main content
15,917,062 members
Home / Discussions / C#
   

C#

 
GeneralRe: Top books for learning C# (Complete novice) for thermodynamic mathematical modelling Pin
Mahdi Kapateh28-Nov-12 3:04
Mahdi Kapateh28-Nov-12 3:04 
QuestionDynamically loading a plug-in assembly by interface Pin
MJL Rademakers27-Nov-12 4:07
MJL Rademakers27-Nov-12 4:07 
AnswerRe: Dynamically loading a plug-in assembly by interface Pin
Alan N27-Nov-12 4:27
Alan N27-Nov-12 4:27 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
MJL Rademakers27-Nov-12 4:41
MJL Rademakers27-Nov-12 4:41 
AnswerRe: Dynamically loading a plug-in assembly by interface Pin
Pete O'Hanlon27-Nov-12 4:30
mvePete O'Hanlon27-Nov-12 4:30 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
MJL Rademakers27-Nov-12 4:45
MJL Rademakers27-Nov-12 4:45 
AnswerRe: Dynamically loading a plug-in assembly by interface Pin
PIEBALDconsult27-Nov-12 8:17
mvePIEBALDconsult27-Nov-12 8:17 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
BobJanova28-Nov-12 23:49
BobJanova28-Nov-12 23:49 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
PIEBALDconsult29-Nov-12 2:41
mvePIEBALDconsult29-Nov-12 2:41 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
BobJanova29-Nov-12 3:12
BobJanova29-Nov-12 3:12 
GeneralRe: Dynamically loading a plug-in assembly by interface Pin
PIEBALDconsult29-Nov-12 5:58
mvePIEBALDconsult29-Nov-12 5:58 
Questionhandle script error on virtual machine Pin
belea1727-Nov-12 3:35
belea1727-Nov-12 3:35 
AnswerRe: handle script error on virtual machine Pin
Richard MacCutchan27-Nov-12 4:29
mveRichard MacCutchan27-Nov-12 4:29 
GeneralRe: handle script error on virtual machine Pin
belea1727-Nov-12 9:27
belea1727-Nov-12 9:27 
AnswerRe: handle script error on virtual machine Pin
Eddy Vluggen27-Nov-12 13:49
professionalEddy Vluggen27-Nov-12 13:49 
QuestionEn- or disabling labels regarding to checked items in a listbox Pin
Dennis Bork27-Nov-12 3:15
Dennis Bork27-Nov-12 3:15 
Hello all, I am deeply sorry that my first post is a (most likely) pretty stupid question, but I just can't work it out.

Say I have three labels label 1, label 2 and label 3.
Also I have a listbox listBox1 with item1, item2 and item3.
listBox1.SelectionMode is MultiSimple.

If e.g. the list box items 1 and 3 are selected (highlighted) I want the labels 1 and 3 to be visible.

Pretty simple. But I just have a knot in my brain.

One of my tries was that:

C#
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listBox1.SelectedIndex == 0)
   label1.Visible = true;
else
   label1.Visible = false;

if (listBox1.SelectedIndex == 1)
   label2.Visible = true;
else
   label2.Visible = false;
}


Seemed okay to me. But: label2 visibility is only switching regarding to the listbox if item1 is selected.

What would be a good and simple way to accomplish what I want to do?

Really appreciate your help,
thanks

Dennis
AnswerRe: En- or disabling labels regarding to checked items in a listbox Pin
Alan N27-Nov-12 4:36
Alan N27-Nov-12 4:36 
AnswerRe: En- or disabling labels regarding to checked items in a listbox Pin
Richard MacCutchan27-Nov-12 4:52
mveRichard MacCutchan27-Nov-12 4:52 
AnswerRe: En- or disabling labels regarding to checked items in a listbox Pin
Nilesh Raval27-Nov-12 19:22
professionalNilesh Raval27-Nov-12 19:22 
GeneralRe: En- or disabling labels regarding to checked items in a listbox Pin
Dennis Bork28-Nov-12 0:05
Dennis Bork28-Nov-12 0:05 
GeneralRe: En- or disabling labels regarding to checked items in a listbox Pin
Nilesh Raval28-Nov-12 1:05
professionalNilesh Raval28-Nov-12 1:05 
QuestionUnsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack. Pin
MAHAMADLATIF HASAN SANADI27-Nov-12 0:41
MAHAMADLATIF HASAN SANADI27-Nov-12 0:41 
AnswerRe: Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack. Pin
Richard Deeming27-Nov-12 1:06
mveRichard Deeming27-Nov-12 1:06 
Questionhow to load values into combobox Pin
chahthuranga26-Nov-12 22:06
chahthuranga26-Nov-12 22:06 
AnswerRe: how to load values into combobox Pin
Richard MacCutchan26-Nov-12 22:51
mveRichard MacCutchan26-Nov-12 22:51 

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.