Click here to Skip to main content
15,905,867 members
Home / Discussions / C#
   

C#

 
GeneralC#:Problem in DataGridView CellMouseClck Event Pin
kssknov21-Dec-07 0:35
kssknov21-Dec-07 0:35 
GeneralRe: C#:Problem in DataGridView CellMouseClck Event Pin
martin_hughes21-Dec-07 1:34
martin_hughes21-Dec-07 1:34 
Generalimage change on mouse over Pin
Eli Nurman21-Dec-07 0:27
Eli Nurman21-Dec-07 0:27 
GeneralRe: image change on mouse over Pin
Stevo Z21-Dec-07 0:57
Stevo Z21-Dec-07 0:57 
Generalsorting gridview columns Pin
eyeseetee21-Dec-07 0:11
eyeseetee21-Dec-07 0:11 
GeneralRe: sorting gridview columns Pin
martin_hughes21-Dec-07 3:04
martin_hughes21-Dec-07 3:04 
Questionsimple code creating problem .........why ? Pin
sindhutiwari20-Dec-07 23:54
sindhutiwari20-Dec-07 23:54 
AnswerRe: simple code creating problem .........why ? Pin
Colin Angus Mackay21-Dec-07 0:20
Colin Angus Mackay21-Dec-07 0:20 
sindhutiwari wrote:
error is coming at ff.a().. ff.b()...ff.s as object reference not set to an instance of the object ....
plz tell me the problem


The problem is as the exception said. In other words, ff is null.


sindhutiwari wrote:
n..solution too


Think about the sequence that your statements are actually called in. You assign ff to be the MdiParent BEFORE you tell the form what its MdiParent is. Therefore ff is null because MdiParent is null at the time that ff is assigned.

The solution is to assign ff AFTER MdiParent is assigned. OR Don't use ff at all but to reference the MdiParent directly when it is needed.

You might also want to give things a sensible name. Form1, Form2, ff, a(), b() and so on are very poor names. They mean nothing to anybody.


Upcoming FREE developer events:
* Developer Day Scotland

My website | blog


GeneralSystem.FileIOPermission class Pin
Raheem MA20-Dec-07 23:33
Raheem MA20-Dec-07 23:33 
GeneralRe: System.FileIOPermission class Pin
Colin Angus Mackay21-Dec-07 0:06
Colin Angus Mackay21-Dec-07 0:06 
GeneralAdding two projects Pin
Prabhat00320-Dec-07 22:29
Prabhat00320-Dec-07 22:29 
GeneralRe: Adding two projects Pin
Colin Angus Mackay21-Dec-07 0:08
Colin Angus Mackay21-Dec-07 0:08 
GeneralTransfer XML to database Pin
kaluk20-Dec-07 22:24
kaluk20-Dec-07 22:24 
AnswerRe: Transfer XML to database Pin
boersnoes21-Dec-07 3:19
boersnoes21-Dec-07 3:19 
GeneralMdi parent logic .....c#.net Pin
sindhutiwari20-Dec-07 21:58
sindhutiwari20-Dec-07 21:58 
GeneralRe: Mdi parent logic .....c#.net Pin
CKnig20-Dec-07 22:21
CKnig20-Dec-07 22:21 
Generaldisabling gridview Pin
eyeseetee20-Dec-07 21:40
eyeseetee20-Dec-07 21:40 
AnswerRe: disabling gridview Pin
Ujjaval Modi20-Dec-07 21:49
Ujjaval Modi20-Dec-07 21:49 
GeneralRe: disabling gridview Pin
eyeseetee20-Dec-07 22:12
eyeseetee20-Dec-07 22:12 
GeneralRe: disabling gridview [modified] Pin
J4amieC20-Dec-07 22:36
J4amieC20-Dec-07 22:36 
GeneralRe: disabling gridview Pin
eyeseetee20-Dec-07 22:49
eyeseetee20-Dec-07 22:49 
GeneralRe: disabling gridview Pin
DavidNohejl20-Dec-07 22:55
DavidNohejl20-Dec-07 22:55 
GeneralRe: disabling gridview Pin
eyeseetee20-Dec-07 22:57
eyeseetee20-Dec-07 22:57 
GeneralRe: disabling gridview Pin
eyeseetee20-Dec-07 23:03
eyeseetee20-Dec-07 23:03 
GeneralRe: disabling gridview Pin
Raheem MA20-Dec-07 23:39
Raheem MA20-Dec-07 23:39 

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.