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

C#

 
AnswerRe: MDI Parent and Child Pin
hpjchobbes5-Jul-08 8:04
hpjchobbes5-Jul-08 8:04 
GeneralRe: MDI Parent and Child [modified] Pin
benjamin yap6-Jul-08 0:08
benjamin yap6-Jul-08 0:08 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 1:33
professionalDaveyM696-Jul-08 1:33 
GeneralRe: MDI Parent and Child [modified] Pin
benjamin yap6-Jul-08 1:38
benjamin yap6-Jul-08 1:38 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 1:59
professionalDaveyM696-Jul-08 1:59 
GeneralRe: MDI Parent and Child Pin
benjamin yap6-Jul-08 2:07
benjamin yap6-Jul-08 2:07 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 2:18
professionalDaveyM696-Jul-08 2:18 
GeneralRe: MDI Parent and Child [modified] Pin
DaveyM696-Jul-08 4:16
professionalDaveyM696-Jul-08 4:16 
Doing it this way, the only way is to pass the hashtable to FrmLogin by overloading the constructor
FrmLogin:
private Hashtable staffTableFromMain;
public FrmLogin(Hashtable staffTable)
{
    InitializeComponent();
    staffTableFromMain = staffTable;
}
You can then add to the table (as it's passed by reference) directly from fmLogin.

Edit: You'll need to change the line where you create the instance of FrmLogin in FrmMain as well of course!
FrmLogin childLogin = new FrmLogin(staffTable);
It's not the best way though. FrmLogin has no need to know about the staff table and really shouldn't be altering it. Also, imagine if there were other objects apart from frmMain that needed to know that the staffTable had changed... you would have no way to inform them. Thats's what events are for.
Examine the code I gave you before and read up on custom Events and Delegates. It is a far better way to do it and no so difficult when you get your head around it.

Dave

modified on Sunday, July 6, 2008 10:26 AM

GeneralRe: MDI Parent and Child [modified] Pin
benjamin yap6-Jul-08 4:48
benjamin yap6-Jul-08 4:48 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 5:45
professionalDaveyM696-Jul-08 5:45 
GeneralRe: MDI Parent and Child [modified] Pin
benjamin yap6-Jul-08 6:00
benjamin yap6-Jul-08 6:00 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 8:12
professionalDaveyM696-Jul-08 8:12 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 9:22
professionalDaveyM696-Jul-08 9:22 
GeneralRe: MDI Parent and Child Pin
benjamin yap6-Jul-08 15:30
benjamin yap6-Jul-08 15:30 
GeneralRe: MDI Parent and Child Pin
DaveyM697-Jul-08 11:29
professionalDaveyM697-Jul-08 11:29 
GeneralRe: MDI Parent and Child Pin
benjamin yap7-Jul-08 22:35
benjamin yap7-Jul-08 22:35 
QuestionBound combobox problem Pin
Alessandra775-Jul-08 4:38
Alessandra775-Jul-08 4:38 
QuestionHow to get a RGB values from an image buffer? Pin
CopperCircle5-Jul-08 2:58
CopperCircle5-Jul-08 2:58 
AnswerRe: How to get a RGB values from an image buffer? Pin
User 66585-Jul-08 3:07
User 66585-Jul-08 3:07 
AnswerRe: How to get a RGB values from an image buffer? Pin
Guffa5-Jul-08 5:47
Guffa5-Jul-08 5:47 
QuestionCreating DataView filter ... Pin
Jammer5-Jul-08 2:52
Jammer5-Jul-08 2:52 
Questionsetup problem for windows application Pin
K V Sekhar5-Jul-08 1:51
K V Sekhar5-Jul-08 1:51 
AnswerRe: setup problem for windows application Pin
Christian Graus5-Jul-08 2:04
protectorChristian Graus5-Jul-08 2:04 
GeneralRe: setup problem for windows application Pin
K V Sekhar6-Jul-08 21:28
K V Sekhar6-Jul-08 21:28 
Questionhow to change NumberDecimalSeparator ? Pin
Xmen Real 5-Jul-08 1:41
professional Xmen Real 5-Jul-08 1:41 

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.