Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
GeneralRe: output confusion Pin
Luc Pattyn5-Jun-10 2:47
sitebuilderLuc Pattyn5-Jun-10 2:47 
GeneralRe: output confusion Pin
DaveyM695-Jun-10 3:10
professionalDaveyM695-Jun-10 3:10 
GeneralRe: output confusion Pin
Luc Pattyn5-Jun-10 3:23
sitebuilderLuc Pattyn5-Jun-10 3:23 
GeneralRe: output confusion - OT Pin
DaveyM695-Jun-10 4:28
professionalDaveyM695-Jun-10 4:28 
GeneralRe: output confusion - OT Pin
Luc Pattyn5-Jun-10 4:40
sitebuilderLuc Pattyn5-Jun-10 4:40 
GeneralRe: output confusion Pin
Luc Pattyn5-Jun-10 3:31
sitebuilderLuc Pattyn5-Jun-10 3:31 
GeneralRe: output confusion Pin
Estys5-Jun-10 3:11
Estys5-Jun-10 3:11 
QuestionControl: Get value from a Form Pin
MBGustavo4-Jun-10 20:01
MBGustavo4-Jun-10 20:01 
Hello:

I have a MDIParent Form called ICEPack and many MDIChild Forms. For now I am working on the Forms called FormGeneral and FormProduct. When I get these working, then all the rest will be simple. I have a Class called ClassControl where I put all my Controls.

For example... The TextBox events: In ClassControl. This way all my Forms use the same code.

while (TheControlEvent != null)
{
TheEvent = TheControlEvent.GetType().Name;
switch (TheEvent)
{
#region TextBox
case "TextBox":
TheControlEvent.Enter += new EventHandler(TextBoxEnter);
TheControlEvent.Leave += new EventHandler(TextBoxLeave);
TheControlEvent.MouseHover += new EventHandler(TextBoxMouseHover);
TheControlEvent.MouseLeave += new EventHandler(TextBoxMouseLeave);
break;
#endregion
... other code


Before the 'while' I add the following:

TheForm.Enter += new EventHandler(FormEnter);

So there will be only one routine for all Form Enter.

Currently in the MDIChild I have:

public void FormGeneral_Enter(object sender, EventArgs e)
{
FormICEPack.RunAs = RunAs;
FormICEPack.dataGridViewRecord.DataSource = DataTableRecord;
FormICEPack.dataGridViewRecord.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
}


And would like to put this in the ClassControl:

private void FormEnter(object sender, EventArgs e)
{
// Original code from FormGeneral & FormProduct
//FormICEPack.RunAs = RunAs;
//FormICEPack.dataGridViewRecord.DataSource = DataTableRecord;
//FormICEPack.dataGridViewRecord.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

// New code???
//...

Form TheParentForm = Form.ActiveForm; // Get The Parent Form
TheChildForm = TheParentForm.ActiveMdiChild.Name.ToString(); // Get The Child Form

Assembly oAssembly = Assembly.GetEntryAssembly();
Form oForm = (Form)oAssembly.CreateInstance("ICEPack." + TheChildForm + "()");

String RunAs = (String)oForm.Controls.Find("RunAs", true)[0].ToString(); //<<< ERRORMad | :mad:

}
AnswerRe: Control: Get value from a Form Pin
#realJSOP5-Jun-10 2:03
mve#realJSOP5-Jun-10 2:03 
GeneralRe: Control: Get value from a Form Pin
MBGustavo5-Jun-10 4:45
MBGustavo5-Jun-10 4:45 
QuestionIphone programming(Please Help) Pin
future38394-Jun-10 13:57
future38394-Jun-10 13:57 
AnswerRe: Iphone programming(Please Help) Pin
Luc Pattyn4-Jun-10 14:37
sitebuilderLuc Pattyn4-Jun-10 14:37 
GeneralRe: Iphone programming(Please Help) Pin
Not Active5-Jun-10 2:54
mentorNot Active5-Jun-10 2:54 
GeneralRe: Iphone programming(Please Help) Pin
Luc Pattyn5-Jun-10 3:11
sitebuilderLuc Pattyn5-Jun-10 3:11 
QuestionHow can I remotely explore my LAN? Remoting? Pin
Member 18349914-Jun-10 6:57
Member 18349914-Jun-10 6:57 
AnswerRe: How can I remotely explore my LAN? Remoting? Pin
Not Active4-Jun-10 7:06
mentorNot Active4-Jun-10 7:06 
AnswerRe: How can I remotely explore my LAN? Remoting? Pin
#realJSOP4-Jun-10 7:31
mve#realJSOP4-Jun-10 7:31 
AnswerRe: How can I remotely explore my LAN? Remoting? Pin
Member 18349914-Jun-10 8:52
Member 18349914-Jun-10 8:52 
GeneralRe: How can I remotely explore my LAN? Remoting? Pin
#realJSOP5-Jun-10 1:56
mve#realJSOP5-Jun-10 1:56 
Questionproblem in Class Pin
SajjadZare4-Jun-10 6:15
SajjadZare4-Jun-10 6:15 
AnswerRe: problem in Class Pin
Abhinav S4-Jun-10 6:18
Abhinav S4-Jun-10 6:18 
GeneralRe: problem in Class Pin
SajjadZare4-Jun-10 6:51
SajjadZare4-Jun-10 6:51 
GeneralRe: problem in Class Pin
Luc Pattyn4-Jun-10 8:37
sitebuilderLuc Pattyn4-Jun-10 8:37 
GeneralRe: problem in Class Pin
OriginalGriff4-Jun-10 8:50
mveOriginalGriff4-Jun-10 8:50 
GeneralRe: problem in Class Pin
Luc Pattyn4-Jun-10 9:30
sitebuilderLuc Pattyn4-Jun-10 9:30 

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.