Click here to Skip to main content
16,021,288 members
Home / Discussions / C#
   

C#

 
QuestionChange Windows service to run under LocalSystem account from a user account (API) Pin
kulile14-Nov-06 5:11
kulile14-Nov-06 5:11 
QuestionOpening web page in a new tab Pin
Mertli Ozgur Nevres14-Nov-06 4:41
Mertli Ozgur Nevres14-Nov-06 4:41 
AnswerRe: Opening web page in a new tab Pin
Anthony Mushrow14-Nov-06 4:47
professionalAnthony Mushrow14-Nov-06 4:47 
AnswerRe: Opening web page in a new tab Pin
Eduard Keilholz14-Nov-06 4:53
Eduard Keilholz14-Nov-06 4:53 
GeneralRe: Opening web page in a new tab Pin
Mertli Ozgur Nevres14-Nov-06 5:00
Mertli Ozgur Nevres14-Nov-06 5:00 
AnswerRe: Opening web page in a new tab Pin
ednrgc14-Nov-06 5:19
ednrgc14-Nov-06 5:19 
AnswerRe: Opening web page in a new tab Pin
User 665814-Nov-06 5:59
User 665814-Nov-06 5:59 
QuestionProblem with ListBox selectedValueChange event Pin
digitalhand14-Nov-06 4:07
digitalhand14-Nov-06 4:07 
Hi all,


I have a problem with the ListBox Control. Let me first explain my application:

I have here a UserControl (contains list box and dataGridView) and form called AttendanceScreen (which reposibles to send data from database to UserControl). In additon, that form includes that UserControl.

So when the form loaded which contains the userControl, it will send dataSet to the userControl as data source for the listBox.
And when the user select any item from the listBox that event will be triggered by selectedValueChange. The handler of that event will be responsible about sending the value of selectedItem to the form by the Association relationship.

And my problem is located in this moment.

the excaption message said -> "NullReferenceException was unhandled by user code"


My code here:

userControl Class::

<br />
private void employeeListBox_SelectedValueChanged(object sender, EventArgs e)<br />
        {<br />
            if (IsReleased)<br />
            {<br />
                attendScreen.employeeAttendanceTriggered(int.Parse(this.employeeListBox.SelectedValue.ToString()));<br />
            }<br />
        }<br />
<br />


when I tested by MessageBox like

<br />
private void employeeListBox_SelectedValueChanged(object sender, EventArgs e)<br />
        {<br />
            if (IsReleased)<br />
            {<br />
                MessageBox.Show(this.employeeListBox.SelectedValue.ToString());<br />
            }<br />
        }<br />
<br />


it works fine. so where's the problem


*
I forgot to include that when I have tried to do everything in userControl (connecting to database and retrieve data and then displayed in dataGridView, it works fine for the dataGridView BUT all items in ListBox disappeared - no more selectedValueChange event fired)
*


Thanks in advance.
AnswerRe: Problem with ListBox selectedValueChange event Pin
ednrgc14-Nov-06 5:14
ednrgc14-Nov-06 5:14 
GeneralRe: Problem with ListBox selectedValueChange event Pin
digitalhand14-Nov-06 9:49
digitalhand14-Nov-06 9:49 
Questionviews Pin
sadafsagheer14-Nov-06 3:44
sadafsagheer14-Nov-06 3:44 
AnswerRe: views Pin
PlayByTheRules14-Nov-06 4:20
PlayByTheRules14-Nov-06 4:20 
GeneralRe: views Pin
ednrgc14-Nov-06 5:17
ednrgc14-Nov-06 5:17 
AnswerRe: views Pin
saqib8214-Nov-06 23:41
saqib8214-Nov-06 23:41 
QuestionWindows Forms Pin
tommypa7514-Nov-06 3:22
tommypa7514-Nov-06 3:22 
AnswerRe: Windows Forms Pin
ejuanpp14-Nov-06 3:41
ejuanpp14-Nov-06 3:41 
AnswerRe: Windows Forms Pin
ednrgc14-Nov-06 5:20
ednrgc14-Nov-06 5:20 
Questiongetting a string from dll & printing it on richtextbox... Pin
IamHuM14-Nov-06 3:18
IamHuM14-Nov-06 3:18 
AnswerRe: getting a string from dll & printing it on richtextbox... Pin
Eduard Keilholz14-Nov-06 4:46
Eduard Keilholz14-Nov-06 4:46 
Questionscreen resolution changed event Pin
freshonlineMax14-Nov-06 2:54
freshonlineMax14-Nov-06 2:54 
AnswerRe: screen resolution changed event Pin
Martin#14-Nov-06 3:27
Martin#14-Nov-06 3:27 
GeneralRe: screen resolution changed event Pin
freshonlineMax14-Nov-06 4:52
freshonlineMax14-Nov-06 4:52 
GeneralRe: screen resolution changed event Pin
Martin#14-Nov-06 5:21
Martin#14-Nov-06 5:21 
QuestionXML Tree View - Please Guide. [modified] Pin
h@s@n14-Nov-06 2:21
h@s@n14-Nov-06 2:21 
AnswerRe: XML Tree View - Please Guide. Pin
Ed.Poore14-Nov-06 2:24
Ed.Poore14-Nov-06 2:24 

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.