Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: how to load values into combobox Pin
Pete O'Hanlon26-Nov-12 22:53
mvePete O'Hanlon26-Nov-12 22:53 
Questionideal time out problem Pin
VishwaKL26-Nov-12 21:21
VishwaKL26-Nov-12 21:21 
AnswerRe: ideal time out problem Pin
OriginalGriff26-Nov-12 21:43
mveOriginalGriff26-Nov-12 21:43 
GeneralRe: ideal time out problem Pin
VishwaKL26-Nov-12 23:44
VishwaKL26-Nov-12 23:44 
AnswerRe: ideal time out problem Pin
Simon_Whale26-Nov-12 23:48
Simon_Whale26-Nov-12 23:48 
AnswerRe: ideal time out problem Pin
BobJanova28-Nov-12 23:53
BobJanova28-Nov-12 23:53 
GeneralRe: ideal time out problem Pin
VishwaKL29-Nov-12 20:51
VishwaKL29-Nov-12 20:51 
QuestionDetecting Internet Connection Loss Pin
Roger Wright26-Nov-12 16:29
professionalRoger Wright26-Nov-12 16:29 

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.