Click here to Skip to main content
15,914,795 members
Home / Discussions / C#
   

C#

 
QuestionComplex SQL Insert Query Pin
TenRC5-Jun-10 5:05
TenRC5-Jun-10 5:05 
AnswerRe: Complex SQL Insert Query Pin
Not Active5-Jun-10 6:58
mentorNot Active5-Jun-10 6:58 
GeneralRe: Complex SQL Insert Query Pin
TenRC5-Jun-10 13:23
TenRC5-Jun-10 13:23 
QuestionEF question -- get a name of a table [modified] Pin
Lutosław5-Jun-10 4:49
Lutosław5-Jun-10 4:49 
AnswerRe: EF question -- get a name of a table Pin
Not Active5-Jun-10 6:51
mentorNot Active5-Jun-10 6:51 
GeneralRe: EF question -- get a name of a table Pin
Lutosław5-Jun-10 12:14
Lutosław5-Jun-10 12:14 
GeneralRe: EF question -- get a name of a table Pin
Not Active5-Jun-10 13:03
mentorNot Active5-Jun-10 13:03 
GeneralRe: EF question -- get a name of a table Pin
Lutosław5-Jun-10 13:50
Lutosław5-Jun-10 13:50 
GeneralRe: EF question -- get a name of a table Pin
Not Active5-Jun-10 15:18
mentorNot Active5-Jun-10 15:18 
GeneralRe: EF question -- get a name of a table Pin
Lutosław6-Jun-10 4:04
Lutosław6-Jun-10 4:04 
Questionhow to handle Server Not found exception at client side in .net remoting? Pin
amit_834-Jun-10 22:48
professionalamit_834-Jun-10 22:48 
AnswerRe: how to handle Server Not found exception at client side in .net remoting? Pin
#realJSOP5-Jun-10 2:02
professional#realJSOP5-Jun-10 2:02 
Questionoutput confusion Pin
Unknown Ajanabi4-Jun-10 22:03
Unknown Ajanabi4-Jun-10 22:03 
AnswerRe: output confusion Pin
Estys4-Jun-10 22:18
Estys4-Jun-10 22:18 
AnswerRe: output confusion [modified] Pin
DaveyM695-Jun-10 1:35
professionalDaveyM695-Jun-10 1:35 
AnswerRe: output confusion Pin
#realJSOP5-Jun-10 1:58
professional#realJSOP5-Jun-10 1:58 
GeneralRe: output confusion Pin
DaveyM695-Jun-10 2:20
professionalDaveyM695-Jun-10 2:20 
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:

}

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.