Click here to Skip to main content
15,894,955 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hovering Mouse Pin
IceWater422-May-06 12:24
IceWater422-May-06 12:24 
Questionhow to SetParameterValue to crystal sub-report using c# Pin
shabonaa2-May-06 8:01
shabonaa2-May-06 8:01 
QuestionBacking up my source Pin
Tom Wright2-May-06 7:16
Tom Wright2-May-06 7:16 
QuestionReports using Business Object in C# Pin
Neel072-May-06 6:54
Neel072-May-06 6:54 
AnswerRe: Reports using Business Object in C# Pin
shabonaa2-May-06 8:46
shabonaa2-May-06 8:46 
QuestionForm flicks when resize on Timer_Tick Pin
freshonlineMax2-May-06 6:49
freshonlineMax2-May-06 6:49 
AnswerRe: Form flicks when resize on Timer_Tick Pin
CWIZO2-May-06 8:42
CWIZO2-May-06 8:42 
QuestionObject Reference Error while accessing a treenode from a context menu event Pin
Jonathen Scalet2-May-06 5:57
Jonathen Scalet2-May-06 5:57 
Hi-

<br />
private void BuddyList_AfterSelect(object sender, TreeViewEventArgs e)<br />
		{<br />
if (this.BuddyList.SelectedNode.Parent != null) //Group are not Buddies!!<br />
 {<br />
				this.BuddyList_User();<br />
 }<br />
}<br />
<br />
private void menuItem3_Click(object sender, System.EventArgs e)<br />
{<br />
//Get Buddy Info: This will display away messages if the user is away<br />
<br />
if (this.BuddyList.SelectedNode.Parent != null) <br />
{<br />
MessageBox.Show (this.BuddyList.SelectedNode.Text);<br />
}<br />
}<br />


In my menuItem3_Click event I cannot access the selected node of my treeview which is called BuddyList. It throws an object reference error: Object Reference not set to an instance of an object.

However in the function above that in a BuddyList (Treeview) event I access the SelectedNode with no problem and I am not sure why.

When the treeview is rightclick a context menu is display, then when a user selects an option from the context menu the event menuItem3_Click above, needs to check to make sure that the selected tree node is a root node and then display a message box.

Any ideas?

Thanks,
Jon Scalet
AnswerRe: Object Reference Error while accessing a treenode from a context menu event Pin
Judah Gabriel Himango2-May-06 6:03
sponsorJudah Gabriel Himango2-May-06 6:03 
GeneralRe: Object Reference Error while accessing a treenode from a context menu event Pin
J0nScalet2-May-06 6:14
J0nScalet2-May-06 6:14 
GeneralRe: Object Reference Error while accessing a treenode from a context menu event Pin
Judah Gabriel Himango2-May-06 6:33
sponsorJudah Gabriel Himango2-May-06 6:33 
Questionvedio and powerpoint Pin
walaa ibraheem2-May-06 5:26
walaa ibraheem2-May-06 5:26 
AnswerRe: vedio and powerpoint Pin
Judah Gabriel Himango2-May-06 5:55
sponsorJudah Gabriel Himango2-May-06 5:55 
QuestionRefactoring question (performance) Pin
gantww2-May-06 5:25
gantww2-May-06 5:25 
AnswerRe: Refactoring question (performance) Pin
Judah Gabriel Himango2-May-06 6:01
sponsorJudah Gabriel Himango2-May-06 6:01 
AnswerRe: Refactoring question (performance) Pin
Josh Smith2-May-06 7:32
Josh Smith2-May-06 7:32 
GeneralRe: Refactoring question (performance) Pin
gantww2-May-06 8:02
gantww2-May-06 8:02 
QuestionFire a generic event on enter of item on a tab control page Pin
oracleConvert2-May-06 5:00
oracleConvert2-May-06 5:00 
AnswerRe: Fire a generic event on enter of item on a tab control page Pin
Josh Smith2-May-06 5:04
Josh Smith2-May-06 5:04 
GeneralRe: Fire a generic event on enter of item on a tab control page Pin
oracleConvert2-May-06 5:11
oracleConvert2-May-06 5:11 
GeneralRe: Fire a generic event on enter of item on a tab control page Pin
Josh Smith2-May-06 5:48
Josh Smith2-May-06 5:48 
GeneralRe: Fire a generic event on enter of item on a tab control page Pin
oracleConvert2-May-06 6:07
oracleConvert2-May-06 6:07 
QuestionCrystal Report Matter Pin
ventomito2-May-06 4:31
ventomito2-May-06 4:31 
Questionwebdav exchange server Pin
mhusleag2-May-06 4:25
mhusleag2-May-06 4:25 
QuestionToolStripTextBox disappearing in context menu Pin
Wjousts2-May-06 4:11
Wjousts2-May-06 4:11 

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.